Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add destination IP address as parameter for PLS #26075

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
* Added support for `DefaultOutboundAccess` property in `Set-AzVirtualNetworkSubnetConfig` command
* Added support for `EnabledFilteringCriteria` property in `New-AzNetworkWatcherFlowLog` and `Set-AzNetworkWatcherFlowLog` commands
* Added support of `UserAssignedIdentityId` Property in `New-AzNetworkWatcherFlowLog` and `Set-AzNetworkWatcherFlowLog` commands
* Added support of `DestinationIPAddress` property in `New-AzPrivateLinkService` command
- `LoadBalancerFrontendIpConfiguration` is not a mandatory parameter anymore.
- The user can provide either `LoadBalancerFrontendIpConfiguration` or `DestinationIPAddress`.

## Version 7.8.0
* Added new cmdlets to support Save & Commit (AzureFirewallPolicy draft)
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/Models/PSPrivateLinkService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public partial class PSPrivateLinkService : PSTopLevelResource

public PSExtendedLocation ExtendedLocation { get; set; }

public string DestinationIPAddress { get; set; }

[JsonIgnore]
public string LoadBalancerFrontendIpConfigurationsText
{
Expand Down
4 changes: 4 additions & 0 deletions src/Network/Network/Network.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -5664,6 +5664,10 @@
<Label>ExtendedLocation</Label>
<PropertyName>ExtendedLocationText</PropertyName>
</ListItem>
<ListItem>
<Label>DestinationIPAddress</Label>
<PropertyName>DestinationIPAddress</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ public class NewAzurePrivateLinkService : PrivateLinkServiceBaseCmdlet
[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The front end ip configuration")]
HelpMessage = "The ip configuration")]
[ValidateNotNullOrEmpty]
public PSFrontendIPConfiguration[] LoadBalancerFrontendIpConfiguration { get; set; }
public PSPrivateLinkServiceIpConfiguration[] IpConfiguration { get; set; }

[Parameter(
Mandatory = true,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The ip configuration")]
HelpMessage = "The front end ip configuration")]
[ValidateNotNullOrEmpty]
public PSPrivateLinkServiceIpConfiguration[] IpConfiguration { get; set; }
public PSFrontendIPConfiguration[] LoadBalancerFrontendIpConfiguration { get; set; }

[Parameter(
Mandatory = false,
Expand Down Expand Up @@ -104,6 +104,12 @@ public class NewAzurePrivateLinkService : PrivateLinkServiceBaseCmdlet
HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The destination IP address")]
public string DestinationIPAddress { get; set; }

private PSPrivateLinkService CreatePSPrivateLinkService()
{
var psPrivateLinkService = new PSPrivateLinkService
Expand Down Expand Up @@ -135,6 +141,8 @@ private PSPrivateLinkService CreatePSPrivateLinkService()
psPrivateLinkService.ExtendedLocation = new PSExtendedLocation(this.EdgeZone);
}

psPrivateLinkService.DestinationIPAddress = this.DestinationIPAddress;

var plsModel = NetworkResourceManagerProfile.Mapper.Map<MNM.PrivateLinkService>(psPrivateLinkService);
plsModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);

Expand Down
42 changes: 36 additions & 6 deletions src/Network/Network/help/New-AzPrivateLinkService.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Creates a private link service

```
New-AzPrivateLinkService -Name <String> -ResourceGroupName <String> -Location <String>
-LoadBalancerFrontendIpConfiguration <PSFrontendIPConfiguration[]>
-IpConfiguration <PSPrivateLinkServiceIpConfiguration[]> [-Visibility <String[]>] [-AutoApproval <String[]>]
[-EnableProxyProtocol] [-EdgeZone <String>] [-Tag <Hashtable>] [-Force] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
-IpConfiguration <PSPrivateLinkServiceIpConfiguration[]> [-Visibility <String[]>] [-AutoApproval <String[]>]
[-DestinationIPAddress <String>] [-EnableProxyProtocol] [-EdgeZone <String>] [-Tag <Hashtable>] [-Force] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [-LoadBalancerFrontendIpConfiguration <PSFrontendIPConfiguration[]>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -27,7 +27,7 @@ The **New-AzPrivateLinkService** cmdlet creates a private link service

### Example 1

The following example creates a private link service.
The following example creates a private link service with a load balancer.

```powershell
$vnet = Get-AzVirtualNetwork -ResourceName 'myvnet' -ResourceGroupName 'myresourcegroup'
Expand All @@ -40,6 +40,21 @@ $lb = New-AzLoadBalancer -Name 'MyLoadBalancer' -ResourceGroupName 'myresourcegr
New-AzPrivateLinkService -Name 'mypls' -ResourceGroupName myresourcegroup -Location "West US" -LoadBalancerFrontendIpConfiguration $frontend -IpConfiguration $IPConfig
```

### Example 2

The following example creates a private link service with destinationIPAddress.

```powershell
$vnet = Get-AzVirtualNetwork -ResourceName 'myvnet' -ResourceGroupName 'myresourcegroup'
# View the results of $vnet and change 'mysubnet' in the following line to the appropriate subnet name.
$subnet = $vnet | Select-Object -ExpandProperty subnets | Where-Object Name -eq 'mysubnet'
$IPConfig1 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config1' -Subnet $subnet -PrivateIpAddress '10.0.0.5' -Primary
$IPConfig2 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config2' -Subnet $subnet -PrivateIpAddress '10.0.0.6'
$IPConfig3 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config3' -Subnet $subnet -PrivateIpAddress '10.0.0.7'
$IPConfigs = @($IPConfig1, $IPConfig2, $IPConfig3)
New-AzPrivateLinkService -Name 'mypls' -ResourceGroupName myresourcegroup -Location "West US" -IpConfiguration $IPConfigs -DestinationIPAddress '192.168.0.5'
```

## PARAMETERS

### -AsJob
Expand Down Expand Up @@ -87,6 +102,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -DestinationIPAddress
The destination IP address of the private link service.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -EdgeZone
The edge zone of the private link service

Expand Down Expand Up @@ -155,7 +185,7 @@ Type: Microsoft.Azure.Commands.Network.Models.PSFrontendIPConfiguration[]
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Expand Down
Loading