1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. NatGateway

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.0 published on Monday, Sep 18, 2023 by Pulumi

aws.ec2.NatGateway

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.0 published on Monday, Sep 18, 2023 by Pulumi

    Provides a resource to create a VPC NAT Gateway.

    Example Usage

    Public NAT

    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 = aws_eip.Example.Id,
            SubnetId = aws_subnet.Example.Id,
            Tags = 
            {
                { "Name", "gw NAT" },
            },
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                aws_internet_gateway.Example,
            },
        });
    
    });
    
    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(aws_eip.Example.Id),
    			SubnetId:     pulumi.Any(aws_subnet.Example.Id),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("gw NAT"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			aws_internet_gateway.Example,
    		}))
    		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.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(aws_eip.example().id())
                .subnetId(aws_subnet.example().id())
                .tags(Map.of("Name", "gw NAT"))
                .build(), CustomResourceOptions.builder()
                    .dependsOn(aws_internet_gateway.example())
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.NatGateway("example",
        allocation_id=aws_eip["example"]["id"],
        subnet_id=aws_subnet["example"]["id"],
        tags={
            "Name": "gw NAT",
        },
        opts=pulumi.ResourceOptions(depends_on=[aws_internet_gateway["example"]]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.NatGateway("example", {
        allocationId: aws_eip.example.id,
        subnetId: aws_subnet.example.id,
        tags: {
            Name: "gw NAT",
        },
    }, {
        dependsOn: [aws_internet_gateway.example],
    });
    
    resources:
      example:
        type: aws:ec2:NatGateway
        properties:
          allocationId: ${aws_eip.example.id}
          subnetId: ${aws_subnet.example.id}
          tags:
            Name: gw NAT
        options:
          dependson:
            - ${aws_internet_gateway.example}
    

    Public NAT with Secondary Private IP Addresses

    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 = aws_eip.Example.Id,
            SubnetId = aws_subnet.Example.Id,
            SecondaryAllocationIds = new[]
            {
                aws_eip.Secondary.Id,
            },
            SecondaryPrivateIpAddresses = new[]
            {
                "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(aws_eip.Example.Id),
    			SubnetId:     pulumi.Any(aws_subnet.Example.Id),
    			SecondaryAllocationIds: pulumi.StringArray{
    				aws_eip.Secondary.Id,
    			},
    			SecondaryPrivateIpAddresses: pulumi.StringArray{
    				pulumi.String("10.0.1.5"),
    			},
    		})
    		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.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(aws_eip.example().id())
                .subnetId(aws_subnet.example().id())
                .secondaryAllocationIds(aws_eip.secondary().id())
                .secondaryPrivateIpAddresses("10.0.1.5")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.NatGateway("example",
        allocation_id=aws_eip["example"]["id"],
        subnet_id=aws_subnet["example"]["id"],
        secondary_allocation_ids=[aws_eip["secondary"]["id"]],
        secondary_private_ip_addresses=["10.0.1.5"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.NatGateway("example", {
        allocationId: aws_eip.example.id,
        subnetId: aws_subnet.example.id,
        secondaryAllocationIds: [aws_eip.secondary.id],
        secondaryPrivateIpAddresses: ["10.0.1.5"],
    });
    
    resources:
      example:
        type: aws:ec2:NatGateway
        properties:
          allocationId: ${aws_eip.example.id}
          subnetId: ${aws_subnet.example.id}
          secondaryAllocationIds:
            - ${aws_eip.secondary.id}
          secondaryPrivateIpAddresses:
            - 10.0.1.5
    

    Private NAT

    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 = aws_subnet.Example.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(aws_subnet.Example.Id),
    		})
    		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.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(aws_subnet.example().id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.NatGateway("example",
        connectivity_type="private",
        subnet_id=aws_subnet["example"]["id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.NatGateway("example", {
        connectivityType: "private",
        subnetId: aws_subnet.example.id,
    });
    
    resources:
      example:
        type: aws:ec2:NatGateway
        properties:
          connectivityType: private
          subnetId: ${aws_subnet.example.id}
    

    Private NAT with Secondary Private IP Addresses

    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 = aws_subnet.Example.Id,
            SecondaryPrivateIpAddressCount = 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(aws_subnet.Example.Id),
    			SecondaryPrivateIpAddressCount: pulumi.Int(7),
    		})
    		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.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(aws_subnet.example().id())
                .secondaryPrivateIpAddressCount(7)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.NatGateway("example",
        connectivity_type="private",
        subnet_id=aws_subnet["example"]["id"],
        secondary_private_ip_address_count=7)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.NatGateway("example", {
        connectivityType: "private",
        subnetId: aws_subnet.example.id,
        secondaryPrivateIpAddressCount: 7,
    });
    
    resources:
      example:
        type: aws:ec2:NatGateway
        properties:
          connectivityType: private
          subnetId: ${aws_subnet.example.id}
          secondaryPrivateIpAddressCount: 7
    

    Create NatGateway Resource

    new NatGateway(name: string, args: NatGatewayArgs, opts?: CustomResourceOptions);
    @overload
    def NatGateway(resource_name: str,
                   opts: Optional[ResourceOptions] = 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,
                   subnet_id: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None)
    @overload
    def NatGateway(resource_name: str,
                   args: NatGatewayArgs,
                   opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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:

    SubnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    AllocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    ConnectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    PrivateIp 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.

    SecondaryAllocationIds List<string>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    SecondaryPrivateIpAddressCount int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    SecondaryPrivateIpAddresses List<string>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    Tags 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.

    SubnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    AllocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    ConnectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    PrivateIp 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.

    SecondaryAllocationIds []string

    A list of secondary allocation EIP IDs for this NAT Gateway.

    SecondaryPrivateIpAddressCount int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    SecondaryPrivateIpAddresses []string

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    Tags 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.

    subnetId String

    The Subnet ID of the subnet in which to place the NAT Gateway.

    allocationId String

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    connectivityType String

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    privateIp 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.

    secondaryAllocationIds List<String>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount Integer

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses List<String>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    tags 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.

    subnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    allocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    connectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    privateIp 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.

    secondaryAllocationIds string[]

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount number

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses string[]

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    tags {[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 of public.

    connectivity_type str

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    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_ids Sequence[str]

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondary_private_ip_address_count int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondary_private_ip_addresses Sequence[str]

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    tags 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.

    subnetId String

    The Subnet ID of the subnet in which to place the NAT Gateway.

    allocationId String

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    connectivityType String

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    privateIp 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.

    secondaryAllocationIds List<String>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount Number

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses List<String>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    tags 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:

    AssociationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    Id string

    The provider-assigned unique ID for this managed resource.

    NetworkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    PublicIp string

    The Elastic IP address associated with the NAT Gateway.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    AssociationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    Id string

    The provider-assigned unique ID for this managed resource.

    NetworkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    PublicIp string

    The Elastic IP address associated with the NAT Gateway.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    associationId String

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    id String

    The provider-assigned unique ID for this managed resource.

    networkInterfaceId String

    The ID of the network interface associated with the NAT Gateway.

    publicIp String

    The Elastic IP address associated with the NAT Gateway.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    associationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    id string

    The provider-assigned unique ID for this managed resource.

    networkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    publicIp string

    The Elastic IP address associated with the NAT Gateway.

    tagsAll {[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 is public.

    id str

    The provider-assigned unique ID for this managed resource.

    network_interface_id str

    The ID of the network interface associated with the NAT Gateway.

    public_ip str

    The Elastic IP address associated with the NAT Gateway.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    associationId String

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    id String

    The provider-assigned unique ID for this managed resource.

    networkInterfaceId String

    The ID of the network interface associated with the NAT Gateway.

    publicIp String

    The Elastic IP address associated with the NAT Gateway.

    tagsAll 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.
    The following state arguments are supported:
    AllocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    AssociationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    ConnectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    NetworkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    PrivateIp 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.

    PublicIp string

    The Elastic IP address associated with the NAT Gateway.

    SecondaryAllocationIds List<string>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    SecondaryPrivateIpAddressCount int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    SecondaryPrivateIpAddresses List<string>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    SubnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    Tags 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.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    AllocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    AssociationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    ConnectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    NetworkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    PrivateIp 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.

    PublicIp string

    The Elastic IP address associated with the NAT Gateway.

    SecondaryAllocationIds []string

    A list of secondary allocation EIP IDs for this NAT Gateway.

    SecondaryPrivateIpAddressCount int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    SecondaryPrivateIpAddresses []string

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    SubnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    Tags 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.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    allocationId String

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    associationId String

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    connectivityType String

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    networkInterfaceId String

    The ID of the network interface associated with the NAT Gateway.

    privateIp 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.

    publicIp String

    The Elastic IP address associated with the NAT Gateway.

    secondaryAllocationIds List<String>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount Integer

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses List<String>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    subnetId String

    The Subnet ID of the subnet in which to place the NAT Gateway.

    tags 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.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    allocationId string

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    associationId string

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    connectivityType string

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    networkInterfaceId string

    The ID of the network interface associated with the NAT Gateway.

    privateIp 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.

    publicIp string

    The Elastic IP address associated with the NAT Gateway.

    secondaryAllocationIds string[]

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount number

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses string[]

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    subnetId string

    The Subnet ID of the subnet in which to place the NAT Gateway.

    tags {[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.

    tagsAll {[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 of public.

    association_id str

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    connectivity_type str

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    network_interface_id str

    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_ids Sequence[str]

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondary_private_ip_address_count int

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondary_private_ip_addresses Sequence[str]

    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.

    tags 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.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    allocationId String

    The Allocation ID of the Elastic IP address for the NAT Gateway. Required for connectivity_type of public.

    associationId String

    The association ID of the Elastic IP address that's associated with the NAT Gateway. Only available when connectivity_type is public.

    connectivityType String

    Connectivity type for the NAT Gateway. Valid values are private and public. Defaults to public.

    networkInterfaceId String

    The ID of the network interface associated with the NAT Gateway.

    privateIp 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.

    publicIp String

    The Elastic IP address associated with the NAT Gateway.

    secondaryAllocationIds List<String>

    A list of secondary allocation EIP IDs for this NAT Gateway.

    secondaryPrivateIpAddressCount Number

    [Private NAT Gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT Gateway.

    secondaryPrivateIpAddresses List<String>

    A list of secondary private IPv4 addresses to assign to the NAT Gateway.

    subnetId String

    The Subnet ID of the subnet in which to place the NAT Gateway.

    tags 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.

    tagsAll 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
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.2.0 published on Monday, Sep 18, 2023 by Pulumi