aws.ec2.NatGateway
Explore with Pulumi AI
Provides a resource to create a VPC NAT Gateway.
Example Usage
Public NAT
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.NatGateway("example", {
allocationId: exampleAwsEip.id,
subnetId: exampleAwsSubnet.id,
tags: {
Name: "gw NAT",
},
}, {
dependsOn: [exampleAwsInternetGateway],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.NatGateway("example",
allocation_id=example_aws_eip["id"],
subnet_id=example_aws_subnet["id"],
tags={
"Name": "gw NAT",
},
opts = pulumi.ResourceOptions(depends_on=[example_aws_internet_gateway]))
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNatGateway(ctx, "example", &ec2.NatGatewayArgs{
AllocationId: pulumi.Any(exampleAwsEip.Id),
SubnetId: pulumi.Any(exampleAwsSubnet.Id),
Tags: pulumi.StringMap{
"Name": pulumi.String("gw NAT"),
},
}, pulumi.DependsOn([]pulumi.Resource{
exampleAwsInternetGateway,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.NatGateway("example", new()
{
AllocationId = exampleAwsEip.Id,
SubnetId = exampleAwsSubnet.Id,
Tags =
{
{ "Name", "gw NAT" },
},
}, new CustomResourceOptions
{
DependsOn =
{
exampleAwsInternetGateway,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NatGateway;
import com.pulumi.aws.ec2.NatGatewayArgs;
import com.pulumi.resources.CustomResourceOptions;
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 example = new NatGateway("example", NatGatewayArgs.builder()
.allocationId(exampleAwsEip.id())
.subnetId(exampleAwsSubnet.id())
.tags(Map.of("Name", "gw NAT"))
.build(), CustomResourceOptions.builder()
.dependsOn(exampleAwsInternetGateway)
.build());
}
}
resources:
example:
type: aws:ec2:NatGateway
properties:
allocationId: ${exampleAwsEip.id}
subnetId: ${exampleAwsSubnet.id}
tags:
Name: gw NAT
options:
dependson:
- ${exampleAwsInternetGateway}
Public NAT with Secondary Private IP Addresses
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.NatGateway("example", {
allocationId: exampleAwsEip.id,
subnetId: exampleAwsSubnet.id,
secondaryAllocationIds: [secondary.id],
secondaryPrivateIpAddresses: ["10.0.1.5"],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.NatGateway("example",
allocation_id=example_aws_eip["id"],
subnet_id=example_aws_subnet["id"],
secondary_allocation_ids=[secondary["id"]],
secondary_private_ip_addresses=["10.0.1.5"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNatGateway(ctx, "example", &ec2.NatGatewayArgs{
AllocationId: pulumi.Any(exampleAwsEip.Id),
SubnetId: pulumi.Any(exampleAwsSubnet.Id),
SecondaryAllocationIds: pulumi.StringArray{
secondary.Id,
},
SecondaryPrivateIpAddresses: pulumi.StringArray{
pulumi.String("10.0.1.5"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.NatGateway("example", new()
{
AllocationId = exampleAwsEip.Id,
SubnetId = exampleAwsSubnet.Id,
SecondaryAllocationIds = new[]
{
secondary.Id,
},
SecondaryPrivateIpAddresses = new[]
{
"10.0.1.5",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NatGateway;
import com.pulumi.aws.ec2.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 example = new NatGateway("example", NatGatewayArgs.builder()
.allocationId(exampleAwsEip.id())
.subnetId(exampleAwsSubnet.id())
.secondaryAllocationIds(secondary.id())
.secondaryPrivateIpAddresses("10.0.1.5")
.build());
}
}
resources:
example:
type: aws:ec2:NatGateway
properties:
allocationId: ${exampleAwsEip.id}
subnetId: ${exampleAwsSubnet.id}
secondaryAllocationIds:
- ${secondary.id}
secondaryPrivateIpAddresses:
- 10.0.1.5
Private NAT
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.NatGateway("example", {
connectivityType: "private",
subnetId: exampleAwsSubnet.id,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.NatGateway("example",
connectivity_type="private",
subnet_id=example_aws_subnet["id"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNatGateway(ctx, "example", &ec2.NatGatewayArgs{
ConnectivityType: pulumi.String("private"),
SubnetId: pulumi.Any(exampleAwsSubnet.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.NatGateway("example", new()
{
ConnectivityType = "private",
SubnetId = exampleAwsSubnet.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NatGateway;
import com.pulumi.aws.ec2.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 example = new NatGateway("example", NatGatewayArgs.builder()
.connectivityType("private")
.subnetId(exampleAwsSubnet.id())
.build());
}
}
resources:
example:
type: aws:ec2:NatGateway
properties:
connectivityType: private
subnetId: ${exampleAwsSubnet.id}
Private NAT with Secondary Private IP Addresses
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.NatGateway("example", {
connectivityType: "private",
subnetId: exampleAwsSubnet.id,
secondaryPrivateIpAddressCount: 7,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.NatGateway("example",
connectivity_type="private",
subnet_id=example_aws_subnet["id"],
secondary_private_ip_address_count=7)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNatGateway(ctx, "example", &ec2.NatGatewayArgs{
ConnectivityType: pulumi.String("private"),
SubnetId: pulumi.Any(exampleAwsSubnet.Id),
SecondaryPrivateIpAddressCount: pulumi.Int(7),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.NatGateway("example", new()
{
ConnectivityType = "private",
SubnetId = exampleAwsSubnet.Id,
SecondaryPrivateIpAddressCount = 7,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NatGateway;
import com.pulumi.aws.ec2.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 example = new NatGateway("example", NatGatewayArgs.builder()
.connectivityType("private")
.subnetId(exampleAwsSubnet.id())
.secondaryPrivateIpAddressCount(7)
.build());
}
}
resources:
example:
type: aws:ec2:NatGateway
properties:
connectivityType: private
subnetId: ${exampleAwsSubnet.id}
secondaryPrivateIpAddressCount: 7
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: NatGatewayArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NatGateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
subnet_id: Optional[str] = None,
allocation_id: Optional[str] = None,
connectivity_type: Optional[str] = None,
private_ip: Optional[str] = None,
secondary_allocation_ids: Optional[Sequence[str]] = None,
secondary_private_ip_address_count: Optional[int] = None,
secondary_private_ip_addresses: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, 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: aws:ec2: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 NatGatewayArgs
- 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 Aws.Ec2.NatGateway("natGatewayResource", new()
{
SubnetId = "string",
AllocationId = "string",
ConnectivityType = "string",
PrivateIp = "string",
SecondaryAllocationIds = new[]
{
"string",
},
SecondaryPrivateIpAddressCount = 0,
SecondaryPrivateIpAddresses = new[]
{
"string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := ec2.NewNatGateway(ctx, "natGatewayResource", &ec2.NatGatewayArgs{
SubnetId: pulumi.String("string"),
AllocationId: pulumi.String("string"),
ConnectivityType: pulumi.String("string"),
PrivateIp: pulumi.String("string"),
SecondaryAllocationIds: pulumi.StringArray{
pulumi.String("string"),
},
SecondaryPrivateIpAddressCount: pulumi.Int(0),
SecondaryPrivateIpAddresses: pulumi.StringArray{
pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var natGatewayResource = new NatGateway("natGatewayResource", NatGatewayArgs.builder()
.subnetId("string")
.allocationId("string")
.connectivityType("string")
.privateIp("string")
.secondaryAllocationIds("string")
.secondaryPrivateIpAddressCount(0)
.secondaryPrivateIpAddresses("string")
.tags(Map.of("string", "string"))
.build());
nat_gateway_resource = aws.ec2.NatGateway("natGatewayResource",
subnet_id="string",
allocation_id="string",
connectivity_type="string",
private_ip="string",
secondary_allocation_ids=["string"],
secondary_private_ip_address_count=0,
secondary_private_ip_addresses=["string"],
tags={
"string": "string",
})
const natGatewayResource = new aws.ec2.NatGateway("natGatewayResource", {
subnetId: "string",
allocationId: "string",
connectivityType: "string",
privateIp: "string",
secondaryAllocationIds: ["string"],
secondaryPrivateIpAddressCount: 0,
secondaryPrivateIpAddresses: ["string"],
tags: {
string: "string",
},
});
type: aws:ec2:NatGateway
properties:
allocationId: string
connectivityType: string
privateIp: string
secondaryAllocationIds:
- string
secondaryPrivateIpAddressCount: 0
secondaryPrivateIpAddresses:
- string
subnetId: string
tags:
string: 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
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:
- Subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- Allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - Connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - Private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- Secondary
Allocation List<string>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- Secondary
Private intIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- Secondary
Private List<string>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- Allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - Connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - Private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- Secondary
Allocation []stringIds - A list of secondary allocation EIP IDs for this NAT Gateway.
- Secondary
Private intIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- Secondary
Private []stringIp Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id String - The Subnet ID of the subnet in which to place the NAT Gateway.
- allocation
Id String - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - connectivity
Type String - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - private
Ip String - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- secondary
Allocation List<String>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private IntegerIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private List<String>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- secondary
Allocation string[]Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private numberIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private string[]Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet_
id str - The Subnet ID of the subnet in which to place the NAT Gateway.
- allocation_
id str - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - connectivity_
type str - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - private_
ip str - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- secondary_
allocation_ Sequence[str]ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary_
private_ intip_ address_ count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary_
private_ Sequence[str]ip_ addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id String - The Subnet ID of the subnet in which to place the NAT Gateway.
- allocation
Id String - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - connectivity
Type String - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - private
Ip String - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- secondary
Allocation List<String>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private NumberIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private List<String>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the NatGateway resource produces the following output properties:
- Association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - Id string
- The provider-assigned unique ID for this managed resource.
- Network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- Public
Ip string - The Elastic IP address associated with the NAT Gateway.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - Id string
- The provider-assigned unique ID for this managed resource.
- Network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- Public
Ip string - The Elastic IP address associated with the NAT Gateway.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- association
Id String - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - id String
- The provider-assigned unique ID for this managed resource.
- network
Interface StringId - The ID of the network interface associated with the NAT Gateway.
- public
Ip String - The Elastic IP address associated with the NAT Gateway.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - id string
- The provider-assigned unique ID for this managed resource.
- network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- public
Ip string - The Elastic IP address associated with the NAT Gateway.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- association_
id str - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - id str
- The provider-assigned unique ID for this managed resource.
- network_
interface_ strid - The ID of the network interface associated with the NAT Gateway.
- public_
ip str - The Elastic IP address associated with the NAT Gateway.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- association
Id String - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - id String
- The provider-assigned unique ID for this managed resource.
- network
Interface StringId - The ID of the network interface associated with the NAT Gateway.
- public
Ip String - The Elastic IP address associated with the NAT Gateway.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing NatGateway Resource
Get an existing NatGateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NatGatewayState, opts?: CustomResourceOptions): NatGateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allocation_id: Optional[str] = None,
association_id: Optional[str] = None,
connectivity_type: Optional[str] = None,
network_interface_id: Optional[str] = None,
private_ip: Optional[str] = None,
public_ip: Optional[str] = None,
secondary_allocation_ids: Optional[Sequence[str]] = None,
secondary_private_ip_address_count: Optional[int] = None,
secondary_private_ip_addresses: Optional[Sequence[str]] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> NatGateway
func GetNatGateway(ctx *Context, name string, id IDInput, state *NatGatewayState, opts ...ResourceOption) (*NatGateway, error)
public static NatGateway Get(string name, Input<string> id, NatGatewayState? state, CustomResourceOptions? opts = null)
public static NatGateway get(String name, Output<String> id, NatGatewayState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - Association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - Connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - Network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- Private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- Public
Ip string - The Elastic IP address associated with the NAT Gateway.
- Secondary
Allocation List<string>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- Secondary
Private intIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- Secondary
Private List<string>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - Association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - Connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - Network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- Private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- Public
Ip string - The Elastic IP address associated with the NAT Gateway.
- Secondary
Allocation []stringIds - A list of secondary allocation EIP IDs for this NAT Gateway.
- Secondary
Private intIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- Secondary
Private []stringIp Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- Subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id String - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - association
Id String - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - connectivity
Type String - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - network
Interface StringId - The ID of the network interface associated with the NAT Gateway.
- private
Ip String - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- public
Ip String - The Elastic IP address associated with the NAT Gateway.
- secondary
Allocation List<String>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private IntegerIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private List<String>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- subnet
Id String - The Subnet ID of the subnet in which to place the NAT Gateway.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id string - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - association
Id string - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - connectivity
Type string - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - network
Interface stringId - The ID of the network interface associated with the NAT Gateway.
- private
Ip string - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- public
Ip string - The Elastic IP address associated with the NAT Gateway.
- secondary
Allocation string[]Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private numberIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private string[]Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- subnet
Id string - The Subnet ID of the subnet in which to place the NAT Gateway.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation_
id str - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - association_
id str - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - connectivity_
type str - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - network_
interface_ strid - The ID of the network interface associated with the NAT Gateway.
- private_
ip str - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- public_
ip str - The Elastic IP address associated with the NAT Gateway.
- secondary_
allocation_ Sequence[str]ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary_
private_ intip_ address_ count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary_
private_ Sequence[str]ip_ addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- subnet_
id str - The Subnet ID of the subnet in which to place the NAT Gateway.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id String - The Allocation ID of the Elastic IP address for the NAT Gateway. Required for
connectivity_type
ofpublic
. - association
Id String - The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when
connectivity_type
ispublic
. - connectivity
Type String - Connectivity type for the NAT Gateway. Valid values are
private
andpublic
. Defaults topublic
. - network
Interface StringId - The ID of the network interface associated with the NAT Gateway.
- private
Ip String - The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
- public
Ip String - The Elastic IP address associated with the NAT Gateway.
- secondary
Allocation List<String>Ids - A list of secondary allocation EIP IDs for this NAT Gateway.
- secondary
Private NumberIp Address Count - [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.
- secondary
Private List<String>Ip Addresses - A list of secondary private IPv4 addresses to assign to the NAT Gateway.
- subnet
Id String - The Subnet ID of the subnet in which to place the NAT Gateway.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import NAT Gateways using the id
. For example:
$ pulumi import aws:ec2/natGateway:NatGateway private_gw nat-05dba92075d71c408
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.