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 dictionary
The following arguments are supported:
- Nat
Gateway stringId - The ID of the NAT gateway.
- Nat
Gateway stringId - The ID of the NAT gateway.
- nat
Gateway StringId - The ID of the NAT gateway.
- nat
Gateway stringId - The ID of the NAT gateway.
- nat_
gateway_ strid - The ID of the NAT gateway.
- nat
Gateway StringId - The ID of the NAT gateway.
getNatGateway Result
The following output properties are available:
- Nat
Gateway stringId - The ID of the NAT gateway.
- Secondary
Allocation List<string>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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - Secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - List<Pulumi.
Aws Native. Outputs. Tag> - The tags for the NAT gateway.
- Nat
Gateway stringId - The ID of the NAT gateway.
- Secondary
Allocation []stringIds - 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - Secondary
Private []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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - Tag
- The tags for the NAT gateway.
- nat
Gateway StringId - The ID of the NAT gateway.
- secondary
Allocation List<String>Ids - Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - List<Tag>
- The tags for the NAT gateway.
- nat
Gateway stringId - The ID of the NAT gateway.
- secondary
Allocation string[]Ids - Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - Sequence[root_Tag]
- The tags for the NAT gateway.
- nat
Gateway StringId - The ID of the NAT gateway.
- secondary
Allocation List<String>Ids - Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
- secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot be set at the same time. - secondary
Private 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.
SecondaryPrivateIpAddressCount
andSecondaryPrivateIpAddresses
cannot 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.