1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. ec2
  5. getNatGateway

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.0.1 published on Tuesday, Oct 1, 2024 by Pulumi

aws-native.ec2.getNatGateway

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.0.1 published on Tuesday, Oct 1, 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.

    Using getNatGateway

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNatGateway(args: GetNatGatewayArgs, opts?: InvokeOptions): Promise<GetNatGatewayResult>
    function getNatGatewayOutput(args: GetNatGatewayOutputArgs, opts?: InvokeOptions): Output<GetNatGatewayResult>
    def get_nat_gateway(nat_gateway_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetNatGatewayResult
    def get_nat_gateway_output(nat_gateway_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetNatGatewayResult]
    func LookupNatGateway(ctx *Context, args *LookupNatGatewayArgs, opts ...InvokeOption) (*LookupNatGatewayResult, error)
    func LookupNatGatewayOutput(ctx *Context, args *LookupNatGatewayOutputArgs, opts ...InvokeOption) LookupNatGatewayResultOutput

    > Note: This function is named LookupNatGateway in the Go SDK.

    public static class GetNatGateway 
    {
        public static Task<GetNatGatewayResult> InvokeAsync(GetNatGatewayArgs args, InvokeOptions? opts = null)
        public static Output<GetNatGatewayResult> Invoke(GetNatGatewayInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNatGatewayResult> getNatGateway(GetNatGatewayArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws-native:ec2:getNatGateway
      arguments:
        # arguments dictionary

    The following arguments are supported:

    NatGatewayId string
    The ID of the NAT gateway.
    NatGatewayId string
    The ID of the NAT gateway.
    natGatewayId String
    The ID of the NAT gateway.
    natGatewayId string
    The ID of the NAT gateway.
    nat_gateway_id str
    The ID of the NAT gateway.
    natGatewayId String
    The ID of the NAT gateway.

    getNatGateway Result

    The following output properties are available:

    NatGatewayId string
    The ID of the NAT gateway.
    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.Outputs.Tag>
    The tags for the NAT gateway.
    NatGatewayId string
    The ID of the NAT gateway.
    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 Tag
    The tags for the NAT gateway.
    natGatewayId String
    The ID of the NAT gateway.
    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.
    natGatewayId string
    The ID of the NAT gateway.
    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.
    nat_gateway_id str
    The ID of the NAT gateway.
    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 Sequence[root_Tag]
    The tags for the NAT gateway.
    natGatewayId String
    The ID of the NAT gateway.
    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.

    Supporting Types

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

    We recommend new projects start with resources from the AWS provider.

    AWS Cloud Control v1.0.1 published on Tuesday, Oct 1, 2024 by Pulumi