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

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

aws-native.ec2.NatGateway

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Specifies a network address translation (NAT) gateway in the specified subnet. You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address. With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see NAT gateways in the Amazon VPC User Guide. If you add a default route (AWS::EC2::Route resource) that points to a NAT gateway, specify the NAT gateway ID for the route’s NatGatewayId property. When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see Allocate an Elastic IP address in the Amazon VPC User Guide.

    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,
                   max_drain_duration_seconds: Optional[int] = None,
                   private_ip_address: 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[Sequence[_root_inputs.TagArgs]] = 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-native: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 ID of the subnet in which the NAT gateway is located.
    AllocationId string
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    ConnectivityType string
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    MaxDrainDurationSeconds int
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    PrivateIpAddress 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>
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    SecondaryPrivateIpAddressCount int
    [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    SecondaryPrivateIpAddresses List<string>
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    The tags for the NAT gateway.
    SubnetId string
    The ID of the subnet in which the NAT gateway is located.
    AllocationId string
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    ConnectivityType string
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    MaxDrainDurationSeconds int
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    PrivateIpAddress 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
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    SecondaryPrivateIpAddressCount int
    [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    SecondaryPrivateIpAddresses []string
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    Tags TagArgs
    The tags for the NAT gateway.
    subnetId String
    The ID of the subnet in which the NAT gateway is located.
    allocationId String
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    connectivityType String
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    maxDrainDurationSeconds Integer
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    privateIpAddress 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>
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    secondaryPrivateIpAddressCount Integer
    [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    secondaryPrivateIpAddresses List<String>
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    tags List<Tag>
    The tags for the NAT gateway.
    subnetId string
    The ID of the subnet in which the NAT gateway is located.
    allocationId string
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    connectivityType string
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    maxDrainDurationSeconds number
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    privateIpAddress 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[]
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    secondaryPrivateIpAddressCount number
    [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    secondaryPrivateIpAddresses string[]
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    tags Tag[]
    The tags for the NAT gateway.
    subnet_id str
    The ID of the subnet in which the NAT gateway is located.
    allocation_id str
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    connectivity_type str
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    max_drain_duration_seconds int
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    private_ip_address 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]
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    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. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    secondary_private_ip_addresses Sequence[str]
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    tags TagArgs]
    The tags for the NAT gateway.
    subnetId String
    The ID of the subnet in which the NAT gateway is located.
    allocationId String
    [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
    connectivityType String
    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
    maxDrainDurationSeconds Number
    The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
    privateIpAddress 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>
    Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
    secondaryPrivateIpAddressCount Number
    [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    secondaryPrivateIpAddresses List<String>
    Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
    tags List<Property Map>
    The tags for the NAT gateway.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    NatGatewayId string
    Id string
    The provider-assigned unique ID for this managed resource.
    NatGatewayId string
    id String
    The provider-assigned unique ID for this managed resource.
    natGatewayId String
    id string
    The provider-assigned unique ID for this managed resource.
    natGatewayId string
    id str
    The provider-assigned unique ID for this managed resource.
    nat_gateway_id str
    id String
    The provider-assigned unique ID for this managed resource.
    natGatewayId String

    Supporting Types

    Tag, TagArgs

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi