azure-native.network.NatGateway
Explore with Pulumi AI
Nat Gateway resource. API Version: 2020-11-01.
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 = "Standard",
},
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network"
"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.SubResourceArgs{
{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"),
},
},
PublicIpPrefixes: []network.SubResourceArgs{
{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"),
},
},
ResourceGroupName: pulumi.String("rg1"),
Sku: &network.NatGatewaySkuArgs{
Name: pulumi.String("Standard"),
},
})
if err != nil {
return err
}
return nil
})
}
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 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(Map.of("id", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"))
.publicIpPrefixes(Map.of("id", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"))
.resourceGroupName("rg1")
.sku(Map.of("name", "Standard"))
.build());
}
}
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=[azure_native.network.SubResourceArgs(
id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1",
)],
public_ip_prefixes=[azure_native.network.SubResourceArgs(
id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1",
)],
resource_group_name="rg1",
sku=azure_native.network.NatGatewaySkuArgs(
name="Standard",
))
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: "Standard",
},
});
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
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 string
- The unique name of the resource.
- args NatGatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args NatGatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatGatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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[]
{
{
{ "id", "string" },
},
},
PublicIpPrefixes = new[]
{
{
{ "id", "string" },
},
},
Sku =
{
{ "name", "string" },
},
Tags =
{
{ "string", "string" },
},
Zones = new[]
{
"string",
},
});
example, err := network.NewNatGateway(ctx, "natGatewayResource", &network.NatGatewayArgs{
ResourceGroupName: "string",
Id: "string",
IdleTimeoutInMinutes: 0,
Location: "string",
NatGatewayName: "string",
PublicIpAddresses: []map[string]interface{}{
map[string]interface{}{
"id": "string",
},
},
PublicIpPrefixes: []map[string]interface{}{
map[string]interface{}{
"id": "string",
},
},
Sku: map[string]interface{}{
"name": "string",
},
Tags: map[string]interface{}{
"string": "string",
},
Zones: []string{
"string",
},
})
var natGatewayResource = new NatGateway("natGatewayResource", NatGatewayArgs.builder()
.resourceGroupName("string")
.id("string")
.idleTimeoutInMinutes(0)
.location("string")
.natGatewayName("string")
.publicIpAddresses(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.publicIpPrefixes(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.sku(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.zones("string")
.build());
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])
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"],
});
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
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
The NatGateway resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group.
- Id string
- Resource ID.
- Idle
Timeout intIn Minutes - The idle timeout of the nat gateway.
- Location string
- Resource location.
- Nat
Gateway stringName - The name of the nat gateway.
- Public
Ip List<Pulumi.Addresses Azure Native. Network. Inputs. Sub Resource> - An array of public ip addresses associated with the nat gateway resource.
- Public
Ip List<Pulumi.Prefixes Azure Native. Network. Inputs. Sub Resource> - An array of public ip prefixes associated with the nat gateway resource.
- Sku
Pulumi.
Azure Native. Network. Inputs. Nat Gateway Sku - The nat gateway SKU.
- Dictionary<string, string>
- Resource tags.
- Zones List<string>
- A list of availability zones denoting the zone in which Nat Gateway should be deployed.
- Resource
Group stringName - The name of the resource group.
- Id string
- Resource ID.
- Idle
Timeout intIn Minutes - The idle timeout of the nat gateway.
- Location string
- Resource location.
- Nat
Gateway stringName - The name of the nat gateway.
- Public
Ip []SubAddresses Resource Args - An array of public ip addresses associated with the nat gateway resource.
- Public
Ip []SubPrefixes Resource Args - An array of public ip prefixes associated with the nat gateway resource.
- Sku
Nat
Gateway Sku Args - The nat gateway SKU.
- map[string]string
- Resource tags.
- Zones []string
- A list of availability zones denoting the zone in which Nat Gateway should be deployed.
- resource
Group StringName - The name of the resource group.
- id String
- Resource ID.
- idle
Timeout IntegerIn Minutes - The idle timeout of the nat gateway.
- location String
- Resource location.
- nat
Gateway StringName - The name of the nat gateway.
- public
Ip List<SubAddresses Resource> - An array of public ip addresses associated with the nat gateway resource.
- public
Ip List<SubPrefixes Resource> - An array of public ip prefixes associated with the nat gateway resource.
- sku
Nat
Gateway Sku - The nat gateway SKU.
- Map<String,String>
- Resource tags.
- zones List<String>
- A list of availability zones denoting the zone in which Nat Gateway should be deployed.
- resource
Group stringName - The name of the resource group.
- id string
- Resource ID.
- idle
Timeout numberIn Minutes - The idle timeout of the nat gateway.
- location string
- Resource location.
- nat
Gateway stringName - The name of the nat gateway.
- public
Ip SubAddresses Resource[] - An array of public ip addresses associated with the nat gateway resource.
- public
Ip SubPrefixes Resource[] - An array of public ip prefixes associated with the nat gateway resource.
- sku
Nat
Gateway Sku - The nat gateway SKU.
- {[key: string]: string}
- Resource tags.
- zones string[]
- A list of availability zones denoting the zone in which Nat Gateway should be deployed.
- resource_
group_ strname - The name of the resource group.
- id str
- Resource ID.
- idle_
timeout_ intin_ minutes - The idle timeout of the nat gateway.
- location str
- Resource location.
- nat_
gateway_ strname - The name of the nat gateway.
- public_
ip_ Sequence[Subaddresses Resource Args] - An array of public ip addresses associated with the nat gateway resource.
- public_
ip_ Sequence[Subprefixes Resource Args] - An array of public ip prefixes associated with the nat gateway resource.
- sku
Nat
Gateway Sku Args - The nat gateway SKU.
- Mapping[str, str]
- Resource tags.
- zones Sequence[str]
- A list of availability zones denoting the zone in which Nat Gateway should be deployed.
- resource
Group StringName - The name of the resource group.
- id String
- Resource ID.
- idle
Timeout NumberIn Minutes - The idle timeout of the nat gateway.
- location String
- Resource location.
- nat
Gateway StringName - The name of the nat gateway.
- public
Ip List<Property Map>Addresses - An array of public ip addresses associated with the nat gateway resource.
- public
Ip List<Property Map>Prefixes - An array of public ip prefixes associated with the nat gateway resource.
- sku Property Map
- The nat gateway SKU.
- 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:
- 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.
- Provisioning
State string - The provisioning state of the NAT gateway resource.
- Resource
Guid string - The resource GUID property of the NAT gateway resource.
- Subnets
List<Pulumi.
Azure Native. Network. Outputs. Sub Resource Response> - An array of references to the subnets using this nat gateway resource.
- Type string
- Resource type.
- 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.
- Provisioning
State string - The provisioning state of the NAT gateway resource.
- Resource
Guid string - The resource GUID property of the NAT gateway resource.
- Subnets
[]Sub
Resource Response - An array of references to the subnets using this nat gateway resource.
- Type string
- Resource type.
- 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.
- provisioning
State String - The provisioning state of the NAT gateway resource.
- resource
Guid String - The resource GUID property of the NAT gateway resource.
- subnets
List<Sub
Resource Response> - An array of references to the subnets using this nat gateway resource.
- type String
- Resource type.
- 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.
- provisioning
State string - The provisioning state of the NAT gateway resource.
- resource
Guid string - The resource GUID property of the NAT gateway resource.
- subnets
Sub
Resource Response[] - An array of references to the subnets using this nat gateway resource.
- type string
- Resource type.
- 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[Sub
Resource Response] - An array of references to the subnets using this nat gateway resource.
- type str
- Resource type.
- 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.
- provisioning
State String - The provisioning state of the NAT gateway resource.
- resource
Guid 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.
Azure Native. Network. Nat Gateway Sku Name - Name of Nat Gateway SKU.
- Name
string | Nat
Gateway Sku Name - Name of Nat Gateway SKU.
- name
String | Nat
Gateway Sku Name - Name of Nat Gateway SKU.
- name
string | Nat
Gateway Sku Name - Name of Nat Gateway SKU.
- name
str | Nat
Gateway Sku Name - Name of Nat Gateway SKU.
- name String | "Standard"
- Name of Nat Gateway SKU.
NatGatewaySkuName, NatGatewaySkuNameArgs
- Standard
- Standard
- Nat
Gateway Sku Name Standard - 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/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0