Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzNatGateway
- Module:
- Az.Network Module
Create new Nat Gateway resource with properties Public Ip Address/Public Ip Prefix, IdleTimeoutInMinutes and Sku.
Syntax
Default (Default)
New-AzNatGateway
-ResourceGroupName <String>
-Name <String>
[-IdleTimeoutInMinutes <Int32>]
[-Zone <String[]>]
[-Sku <String>]
[-Location <String>]
[-Tag <Hashtable>]
[-PublicIpAddress <PSResourceId[]>]
[-PublicIpAddressV6 <PSResourceId[]>]
[-PublicIpPrefix <PSResourceId[]>]
[-PublicIpPrefixV6 <PSResourceId[]>]
[-SourceVirtualNetwork <PSResourceId>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzNatGateway cmdlet creates a Nat Gateway Resource. A natgateway requires the following:
- Public Ip Address and/or Public Ip Prefix
- IdleTimeoutInMinutes
- Sku
- ResourceGroupName
- ResourceName
- Location
Examples
Example 1: Create Nat Gateway with Public Ip Address
$pip = New-AzPublicIpAddress -Name "pip" -ResourceGroupName "natgateway_test" -Location "eastus2" -Sku "Standard" -IdleTimeoutInMinutes 4 -AllocationMethod "static"
$natgateway = New-AzNatGateway -ResourceGroupName "natgateway_test" -Name "nat_gateway" -IdleTimeoutInMinutes 4 -Sku "Standard" -Location "eastus2" -PublicIpAddress $pip
Example 2: Create Nat Gateway with Public Ip Prefix
$publicipprefix = New-AzPublicIpPrefix -Name "prefix2" -ResourceGroupName "natgateway_test" -Location "eastus2" -Sku "Standard" -PrefixLength "31"
$natgateway = New-AzNatGateway -ResourceGroupName "natgateway_test" -Name "nat_gateway" -IdleTimeoutInMinutes 4 -Sku "Standard" -Location "eastus2" -PublicIpPrefix $publicipprefix
Example 3: Create Nat Gateway with Public IP Address in Availability Zone 1
$pip = New-AzPublicIpAddress -Name "pip" -ResourceGroupName "natgateway_test" -Location "eastus2" -Sku "Standard" -IdleTimeoutInMinutes 4 -AllocationMethod "static"
$natgateway = New-AzNatGateway -ResourceGroupName "natgateway_test" -Name "nat_gateway" -IdleTimeoutInMinutes 4 -Sku "Standard" -Location "eastus2" -PublicIpAddress $pip -Zone "1"
The first command creates standard Public IP Address. The second command creates NAT Gateway with Public IP Address in Availability Zone 1.
Parameters
-AsJob
Run cmdlet in the background
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-Force
Do not ask for confirmation if you want to overwrite a resource
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-IdleTimeoutInMinutes
The idle timeout of the nat gateway.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Location
The location.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
The name of the nat gateway.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ResourceName |
Parameter sets
-PublicIpAddress
An array of public ip addresses associated with the nat gateway resource.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PublicIpAddressV6
An array of public IPv6 addresses associated with the nat gateway resource.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PublicIpPrefix
An array of public ip prefixes associated with the nat gateway resource.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PublicIpPrefixV6
An array of public IPv6 prefixes associated with the nat gateway resource.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
The resource group name of the nat gateway.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Sku
Name of a NAT gateway SKU.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SourceVirtualNetwork
The id of the source virtual network using this nat gateway resource.
Parameter properties
| Type: | PSResourceId |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Tag
A hashtable which represents resource tags.
Parameter properties
| Type: | Hashtable |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
-Zone
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Int32
Hashtable
PSResourceId
Outputs
PSNatGateway
Azure PowerShell
Feedback
Was this page helpful?
