We recommend new projects start with resources from the AWS provider.
aws-native.ec2.getNatGateway
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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 dictionaryThe following arguments are supported:
- NatGateway stringId 
- The ID of the NAT gateway.
- NatGateway stringId 
- The ID of the NAT gateway.
- natGateway StringId 
- The ID of the NAT gateway.
- natGateway stringId 
- The ID of the NAT gateway.
- nat_gateway_ strid 
- The ID of the NAT gateway.
- natGateway StringId 
- The ID of the NAT gateway.
getNatGateway Result
The following output properties are available:
- NatGateway stringId 
- The ID of the NAT gateway.
- SecondaryAllocation List<string>Ids 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- SecondaryPrivate intIp Address Count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- SecondaryPrivate List<string>Ip Addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- 
List<Pulumi.Aws Native. Outputs. Tag> 
- The tags for the NAT gateway.
- NatGateway stringId 
- The ID of the NAT gateway.
- SecondaryAllocation []stringIds 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- SecondaryPrivate intIp Address Count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- SecondaryPrivate []stringIp Addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- Tag
- The tags for the NAT gateway.
- natGateway StringId 
- The ID of the NAT gateway.
- secondaryAllocation List<String>Ids 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondaryPrivate IntegerIp Address Count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- secondaryPrivate List<String>Ip Addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- List<Tag>
- The tags for the NAT gateway.
- natGateway stringId 
- The ID of the NAT gateway.
- secondaryAllocation string[]Ids 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondaryPrivate numberIp Address Count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- secondaryPrivate string[]Ip Addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- Tag[]
- The tags for the NAT gateway.
- nat_gateway_ strid 
- The ID of the NAT gateway.
- secondary_allocation_ Sequence[str]ids 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondary_private_ intip_ address_ count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- secondary_private_ Sequence[str]ip_ addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- Sequence[root_Tag]
- The tags for the NAT gateway.
- natGateway StringId 
- The ID of the NAT gateway.
- secondaryAllocation List<String>Ids 
- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondaryPrivate NumberIp Address Count 
- [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.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- secondaryPrivate List<String>Ip Addresses 
- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.
- List<Property Map>
- The tags for the NAT gateway.
Supporting Types
Tag
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.