1. Packages
  2. Azure Native
  3. API Docs
  4. network
  5. NatGateway
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.network.NatGateway

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

Nat Gateway resource.

Uses Azure REST API version 2024-05-01. In version 2.x of the Azure Native provider, it used API version 2023-02-01.

Other available API versions: 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2021-03-01, 2021-05-01, 2021-08-01, 2022-01-01, 2022-05-01, 2022-07-01, 2022-09-01, 2022-11-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native network [ApiVersion]. See the version guide for details.

Example Usage

Create nat gateway

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var natGateway = new AzureNative.Network.NatGateway("natGateway", new()
    {
        Location = "westus",
        NatGatewayName = "test-natgateway",
        PublicIpAddresses = new[]
        {
            new AzureNative.Network.Inputs.SubResourceArgs
            {
                Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1",
            },
        },
        PublicIpPrefixes = new[]
        {
            new AzureNative.Network.Inputs.SubResourceArgs
            {
                Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1",
            },
        },
        ResourceGroupName = "rg1",
        Sku = new AzureNative.Network.Inputs.NatGatewaySkuArgs
        {
            Name = AzureNative.Network.NatGatewaySkuName.Standard,
        },
    });

});
Copy
package main

import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewNatGateway(ctx, "natGateway", &network.NatGatewayArgs{
			Location:       pulumi.String("westus"),
			NatGatewayName: pulumi.String("test-natgateway"),
			PublicIpAddresses: network.SubResourceArray{
				&network.SubResourceArgs{
					Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"),
				},
			},
			PublicIpPrefixes: network.SubResourceArray{
				&network.SubResourceArgs{
					Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"),
				},
			},
			ResourceGroupName: pulumi.String("rg1"),
			Sku: &network.NatGatewaySkuArgs{
				Name: pulumi.String(network.NatGatewaySkuNameStandard),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.NatGateway;
import com.pulumi.azurenative.network.NatGatewayArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
import com.pulumi.azurenative.network.inputs.NatGatewaySkuArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var natGateway = new NatGateway("natGateway", NatGatewayArgs.builder()
            .location("westus")
            .natGatewayName("test-natgateway")
            .publicIpAddresses(SubResourceArgs.builder()
                .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1")
                .build())
            .publicIpPrefixes(SubResourceArgs.builder()
                .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1")
                .build())
            .resourceGroupName("rg1")
            .sku(NatGatewaySkuArgs.builder()
                .name("Standard")
                .build())
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const natGateway = new azure_native.network.NatGateway("natGateway", {
    location: "westus",
    natGatewayName: "test-natgateway",
    publicIpAddresses: [{
        id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1",
    }],
    publicIpPrefixes: [{
        id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1",
    }],
    resourceGroupName: "rg1",
    sku: {
        name: azure_native.network.NatGatewaySkuName.Standard,
    },
});
Copy
import pulumi
import pulumi_azure_native as azure_native

nat_gateway = azure_native.network.NatGateway("natGateway",
    location="westus",
    nat_gateway_name="test-natgateway",
    public_ip_addresses=[{
        "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1",
    }],
    public_ip_prefixes=[{
        "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1",
    }],
    resource_group_name="rg1",
    sku={
        "name": azure_native.network.NatGatewaySkuName.STANDARD,
    })
Copy
resources:
  natGateway:
    type: azure-native:network:NatGateway
    properties:
      location: westus
      natGatewayName: test-natgateway
      publicIpAddresses:
        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1
      publicIpPrefixes:
        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1
      resourceGroupName: rg1
      sku:
        name: Standard
Copy

Create NatGateway Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NatGateway(name: string, args: NatGatewayArgs, opts?: CustomResourceOptions);
@overload
def NatGateway(resource_name: str,
               args: NatGatewayInitArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def NatGateway(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               resource_group_name: Optional[str] = None,
               id: Optional[str] = None,
               idle_timeout_in_minutes: Optional[int] = None,
               location: Optional[str] = None,
               nat_gateway_name: Optional[str] = None,
               public_ip_addresses: Optional[Sequence[SubResourceArgs]] = None,
               public_ip_prefixes: Optional[Sequence[SubResourceArgs]] = None,
               sku: Optional[NatGatewaySkuArgs] = None,
               tags: Optional[Mapping[str, str]] = None,
               zones: Optional[Sequence[str]] = None)
func NewNatGateway(ctx *Context, name string, args NatGatewayArgs, opts ...ResourceOption) (*NatGateway, error)
public NatGateway(string name, NatGatewayArgs args, CustomResourceOptions? opts = null)
public NatGateway(String name, NatGatewayArgs args)
public NatGateway(String name, NatGatewayArgs args, CustomResourceOptions options)
type: azure-native:network:NatGateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NatGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NatGatewayInitArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NatGatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NatGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NatGatewayArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var natGatewayResource = new AzureNative.Network.NatGateway("natGatewayResource", new()
{
    ResourceGroupName = "string",
    Id = "string",
    IdleTimeoutInMinutes = 0,
    Location = "string",
    NatGatewayName = "string",
    PublicIpAddresses = new[]
    {
        new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "string",
        },
    },
    PublicIpPrefixes = new[]
    {
        new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "string",
        },
    },
    Sku = new AzureNative.Network.Inputs.NatGatewaySkuArgs
    {
        Name = "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
    Zones = new[]
    {
        "string",
    },
});
Copy
example, err := network.NewNatGateway(ctx, "natGatewayResource", &network.NatGatewayArgs{
	ResourceGroupName:    pulumi.String("string"),
	Id:                   pulumi.String("string"),
	IdleTimeoutInMinutes: pulumi.Int(0),
	Location:             pulumi.String("string"),
	NatGatewayName:       pulumi.String("string"),
	PublicIpAddresses: network.SubResourceArray{
		&network.SubResourceArgs{
			Id: pulumi.String("string"),
		},
	},
	PublicIpPrefixes: network.SubResourceArray{
		&network.SubResourceArgs{
			Id: pulumi.String("string"),
		},
	},
	Sku: &network.NatGatewaySkuArgs{
		Name: pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Zones: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var natGatewayResource = new NatGateway("natGatewayResource", NatGatewayArgs.builder()
    .resourceGroupName("string")
    .id("string")
    .idleTimeoutInMinutes(0)
    .location("string")
    .natGatewayName("string")
    .publicIpAddresses(SubResourceArgs.builder()
        .id("string")
        .build())
    .publicIpPrefixes(SubResourceArgs.builder()
        .id("string")
        .build())
    .sku(NatGatewaySkuArgs.builder()
        .name("string")
        .build())
    .tags(Map.of("string", "string"))
    .zones("string")
    .build());
Copy
nat_gateway_resource = azure_native.network.NatGateway("natGatewayResource",
    resource_group_name="string",
    id="string",
    idle_timeout_in_minutes=0,
    location="string",
    nat_gateway_name="string",
    public_ip_addresses=[{
        "id": "string",
    }],
    public_ip_prefixes=[{
        "id": "string",
    }],
    sku={
        "name": "string",
    },
    tags={
        "string": "string",
    },
    zones=["string"])
Copy
const natGatewayResource = new azure_native.network.NatGateway("natGatewayResource", {
    resourceGroupName: "string",
    id: "string",
    idleTimeoutInMinutes: 0,
    location: "string",
    natGatewayName: "string",
    publicIpAddresses: [{
        id: "string",
    }],
    publicIpPrefixes: [{
        id: "string",
    }],
    sku: {
        name: "string",
    },
    tags: {
        string: "string",
    },
    zones: ["string"],
});
Copy
type: azure-native:network:NatGateway
properties:
    id: string
    idleTimeoutInMinutes: 0
    location: string
    natGatewayName: string
    publicIpAddresses:
        - id: string
    publicIpPrefixes:
        - id: string
    resourceGroupName: string
    sku:
        name: string
    tags:
        string: string
    zones:
        - string
Copy

NatGateway Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NatGateway resource accepts the following input properties:

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Id string
Resource ID.
IdleTimeoutInMinutes int
The idle timeout of the nat gateway.
Location string
Resource location.
NatGatewayName Changes to this property will trigger replacement. string
The name of the nat gateway.
PublicIpAddresses List<Pulumi.AzureNative.Network.Inputs.SubResource>
An array of public ip addresses associated with the nat gateway resource.
PublicIpPrefixes List<Pulumi.AzureNative.Network.Inputs.SubResource>
An array of public ip prefixes associated with the nat gateway resource.
Sku Pulumi.AzureNative.Network.Inputs.NatGatewaySku
The nat gateway SKU.
Tags Dictionary<string, string>
Resource tags.
Zones List<string>
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Id string
Resource ID.
IdleTimeoutInMinutes int
The idle timeout of the nat gateway.
Location string
Resource location.
NatGatewayName Changes to this property will trigger replacement. string
The name of the nat gateway.
PublicIpAddresses []SubResourceArgs
An array of public ip addresses associated with the nat gateway resource.
PublicIpPrefixes []SubResourceArgs
An array of public ip prefixes associated with the nat gateway resource.
Sku NatGatewaySkuArgs
The nat gateway SKU.
Tags map[string]string
Resource tags.
Zones []string
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
id String
Resource ID.
idleTimeoutInMinutes Integer
The idle timeout of the nat gateway.
location String
Resource location.
natGatewayName Changes to this property will trigger replacement. String
The name of the nat gateway.
publicIpAddresses List<SubResource>
An array of public ip addresses associated with the nat gateway resource.
publicIpPrefixes List<SubResource>
An array of public ip prefixes associated with the nat gateway resource.
sku NatGatewaySku
The nat gateway SKU.
tags Map<String,String>
Resource tags.
zones List<String>
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
id string
Resource ID.
idleTimeoutInMinutes number
The idle timeout of the nat gateway.
location string
Resource location.
natGatewayName Changes to this property will trigger replacement. string
The name of the nat gateway.
publicIpAddresses SubResource[]
An array of public ip addresses associated with the nat gateway resource.
publicIpPrefixes SubResource[]
An array of public ip prefixes associated with the nat gateway resource.
sku NatGatewaySku
The nat gateway SKU.
tags {[key: string]: string}
Resource tags.
zones string[]
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
id str
Resource ID.
idle_timeout_in_minutes int
The idle timeout of the nat gateway.
location str
Resource location.
nat_gateway_name Changes to this property will trigger replacement. str
The name of the nat gateway.
public_ip_addresses Sequence[SubResourceArgs]
An array of public ip addresses associated with the nat gateway resource.
public_ip_prefixes Sequence[SubResourceArgs]
An array of public ip prefixes associated with the nat gateway resource.
sku NatGatewaySkuArgs
The nat gateway SKU.
tags Mapping[str, str]
Resource tags.
zones Sequence[str]
A list of availability zones denoting the zone in which Nat Gateway should be deployed.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
id String
Resource ID.
idleTimeoutInMinutes Number
The idle timeout of the nat gateway.
location String
Resource location.
natGatewayName Changes to this property will trigger replacement. String
The name of the nat gateway.
publicIpAddresses List<Property Map>
An array of public ip addresses associated with the nat gateway resource.
publicIpPrefixes List<Property Map>
An array of public ip prefixes associated with the nat gateway resource.
sku Property Map
The nat gateway SKU.
tags Map<String>
Resource tags.
zones List<String>
A list of availability zones denoting the zone in which Nat Gateway should be deployed.

Outputs

All input properties are implicitly available as output properties. Additionally, the NatGateway resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Etag string
A unique read-only string that changes whenever the resource is updated.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
ProvisioningState string
The provisioning state of the NAT gateway resource.
ResourceGuid string
The resource GUID property of the NAT gateway resource.
Subnets List<Pulumi.AzureNative.Network.Outputs.SubResourceResponse>
An array of references to the subnets using this nat gateway resource.
Type string
Resource type.
AzureApiVersion string
The Azure API version of the resource.
Etag string
A unique read-only string that changes whenever the resource is updated.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
ProvisioningState string
The provisioning state of the NAT gateway resource.
ResourceGuid string
The resource GUID property of the NAT gateway resource.
Subnets []SubResourceResponse
An array of references to the subnets using this nat gateway resource.
Type string
Resource type.
azureApiVersion String
The Azure API version of the resource.
etag String
A unique read-only string that changes whenever the resource is updated.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
provisioningState String
The provisioning state of the NAT gateway resource.
resourceGuid String
The resource GUID property of the NAT gateway resource.
subnets List<SubResourceResponse>
An array of references to the subnets using this nat gateway resource.
type String
Resource type.
azureApiVersion string
The Azure API version of the resource.
etag string
A unique read-only string that changes whenever the resource is updated.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name.
provisioningState string
The provisioning state of the NAT gateway resource.
resourceGuid string
The resource GUID property of the NAT gateway resource.
subnets SubResourceResponse[]
An array of references to the subnets using this nat gateway resource.
type string
Resource type.
azure_api_version str
The Azure API version of the resource.
etag str
A unique read-only string that changes whenever the resource is updated.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name.
provisioning_state str
The provisioning state of the NAT gateway resource.
resource_guid str
The resource GUID property of the NAT gateway resource.
subnets Sequence[SubResourceResponse]
An array of references to the subnets using this nat gateway resource.
type str
Resource type.
azureApiVersion String
The Azure API version of the resource.
etag String
A unique read-only string that changes whenever the resource is updated.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
provisioningState String
The provisioning state of the NAT gateway resource.
resourceGuid String
The resource GUID property of the NAT gateway resource.
subnets List<Property Map>
An array of references to the subnets using this nat gateway resource.
type String
Resource type.

Supporting Types

NatGatewaySku
, NatGatewaySkuArgs

Name string | Pulumi.AzureNative.Network.NatGatewaySkuName
Name of Nat Gateway SKU.
Name string | NatGatewaySkuName
Name of Nat Gateway SKU.
name String | NatGatewaySkuName
Name of Nat Gateway SKU.
name string | NatGatewaySkuName
Name of Nat Gateway SKU.
name str | NatGatewaySkuName
Name of Nat Gateway SKU.
name String | "Standard"
Name of Nat Gateway SKU.

NatGatewaySkuName
, NatGatewaySkuNameArgs

Standard
Standard
NatGatewaySkuNameStandard
Standard
Standard
Standard
Standard
Standard
STANDARD
Standard
"Standard"
Standard

NatGatewaySkuResponse
, NatGatewaySkuResponseArgs

Name string
Name of Nat Gateway SKU.
Name string
Name of Nat Gateway SKU.
name String
Name of Nat Gateway SKU.
name string
Name of Nat Gateway SKU.
name str
Name of Nat Gateway SKU.
name String
Name of Nat Gateway SKU.

SubResource
, SubResourceArgs

Id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
Id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id String
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id str
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id String
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.

SubResourceResponse
, SubResourceResponseArgs

Id string
Resource ID.
Id string
Resource ID.
id String
Resource ID.
id string
Resource ID.
id str
Resource ID.
id String
Resource ID.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:NatGateway test-natGateway /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi