AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

getNatGateway

Provides details about a specific Nat Gateway.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var subnetId = config.RequireObject<dynamic>("subnetId");
    var @default = Aws.Ec2.GetNatGateway.Invoke(new()
    {
        SubnetId = aws_subnet.Public.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		subnetId := cfg.RequireObject("subnetId")
		_, err := ec2.LookupNatGateway(ctx, &ec2.LookupNatGatewayArgs{
			SubnetId: pulumi.StringRef(aws_subnet.Public.Id),
		}, nil)
		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.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetNatGatewayArgs;
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) {
        final var config = ctx.config();
        final var subnetId = config.get("subnetId");
        final var default = Ec2Functions.getNatGateway(GetNatGatewayArgs.builder()
            .subnetId(aws_subnet.public().id())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

config = pulumi.Config()
subnet_id = config.require_object("subnetId")
default = aws.ec2.get_nat_gateway(subnet_id=aws_subnet["public"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const subnetId = config.requireObject("subnetId");
const default = aws.ec2.getNatGateway({
    subnetId: aws_subnet["public"].id,
});
configuration:
  subnetId:
    type: dynamic
variables:
  default:
    Fn::Invoke:
      Function: aws:ec2:getNatGateway
      Arguments:
        subnetId: ${aws_subnet.public.id}

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(filters: Optional[Sequence[GetNatGatewayFilter]] = None,
                    id: Optional[str] = None,
                    state: Optional[str] = None,
                    subnet_id: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    vpc_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetNatGatewayResult
def get_nat_gateway_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetNatGatewayFilterArgs]]]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    state: Optional[pulumi.Input[str]] = None,
                    subnet_id: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    vpc_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:ec2/getNatGateway:getNatGateway
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Filters List<Pulumi.Aws.Ec2.Inputs.GetNatGatewayFilter>

Custom filter block as described below.

Id string

ID of the specific Nat Gateway to retrieve.

State string

State of the NAT gateway (pending | failed | available | deleting | deleted ).

SubnetId string

ID of subnet that the Nat Gateway resides in.

Tags Dictionary<string, string>

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

VpcId string

ID of the VPC that the Nat Gateway resides in.

Filters []GetNatGatewayFilter

Custom filter block as described below.

Id string

ID of the specific Nat Gateway to retrieve.

State string

State of the NAT gateway (pending | failed | available | deleting | deleted ).

SubnetId string

ID of subnet that the Nat Gateway resides in.

Tags map[string]string

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

VpcId string

ID of the VPC that the Nat Gateway resides in.

filters List<GetNatGatewayFilter>

Custom filter block as described below.

id String

ID of the specific Nat Gateway to retrieve.

state String

State of the NAT gateway (pending | failed | available | deleting | deleted ).

subnetId String

ID of subnet that the Nat Gateway resides in.

tags Map<String,String>

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

vpcId String

ID of the VPC that the Nat Gateway resides in.

filters GetNatGatewayFilter[]

Custom filter block as described below.

id string

ID of the specific Nat Gateway to retrieve.

state string

State of the NAT gateway (pending | failed | available | deleting | deleted ).

subnetId string

ID of subnet that the Nat Gateway resides in.

tags {[key: string]: string}

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

vpcId string

ID of the VPC that the Nat Gateway resides in.

filters Sequence[GetNatGatewayFilter]

Custom filter block as described below.

id str

ID of the specific Nat Gateway to retrieve.

state str

State of the NAT gateway (pending | failed | available | deleting | deleted ).

subnet_id str

ID of subnet that the Nat Gateway resides in.

tags Mapping[str, str]

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

vpc_id str

ID of the VPC that the Nat Gateway resides in.

filters List<Property Map>

Custom filter block as described below.

id String

ID of the specific Nat Gateway to retrieve.

state String

State of the NAT gateway (pending | failed | available | deleting | deleted ).

subnetId String

ID of subnet that the Nat Gateway resides in.

tags Map<String>

Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.

vpcId String

ID of the VPC that the Nat Gateway resides in.

getNatGateway Result

The following output properties are available:

AllocationId string

ID of the EIP allocated to the selected Nat Gateway.

ConnectivityType string

Connectivity type of the NAT Gateway.

Id string
NetworkInterfaceId string

The ID of the ENI allocated to the selected Nat Gateway.

PrivateIp string

Private Ip address of the selected Nat Gateway.

PublicIp string

Public Ip (EIP) address of the selected Nat Gateway.

State string
SubnetId string
Tags Dictionary<string, string>
VpcId string
Filters List<Pulumi.Aws.Ec2.Outputs.GetNatGatewayFilter>
AllocationId string

ID of the EIP allocated to the selected Nat Gateway.

ConnectivityType string

Connectivity type of the NAT Gateway.

Id string
NetworkInterfaceId string

The ID of the ENI allocated to the selected Nat Gateway.

PrivateIp string

Private Ip address of the selected Nat Gateway.

PublicIp string

Public Ip (EIP) address of the selected Nat Gateway.

State string
SubnetId string
Tags map[string]string
VpcId string
Filters []GetNatGatewayFilter
allocationId String

ID of the EIP allocated to the selected Nat Gateway.

connectivityType String

Connectivity type of the NAT Gateway.

id String
networkInterfaceId String

The ID of the ENI allocated to the selected Nat Gateway.

privateIp String

Private Ip address of the selected Nat Gateway.

publicIp String

Public Ip (EIP) address of the selected Nat Gateway.

state String
subnetId String
tags Map<String,String>
vpcId String
filters List<GetNatGatewayFilter>
allocationId string

ID of the EIP allocated to the selected Nat Gateway.

connectivityType string

Connectivity type of the NAT Gateway.

id string
networkInterfaceId string

The ID of the ENI allocated to the selected Nat Gateway.

privateIp string

Private Ip address of the selected Nat Gateway.

publicIp string

Public Ip (EIP) address of the selected Nat Gateway.

state string
subnetId string
tags {[key: string]: string}
vpcId string
filters GetNatGatewayFilter[]
allocation_id str

ID of the EIP allocated to the selected Nat Gateway.

connectivity_type str

Connectivity type of the NAT Gateway.

id str
network_interface_id str

The ID of the ENI allocated to the selected Nat Gateway.

private_ip str

Private Ip address of the selected Nat Gateway.

public_ip str

Public Ip (EIP) address of the selected Nat Gateway.

state str
subnet_id str
tags Mapping[str, str]
vpc_id str
filters Sequence[GetNatGatewayFilter]
allocationId String

ID of the EIP allocated to the selected Nat Gateway.

connectivityType String

Connectivity type of the NAT Gateway.

id String
networkInterfaceId String

The ID of the ENI allocated to the selected Nat Gateway.

privateIp String

Private Ip address of the selected Nat Gateway.

publicIp String

Public Ip (EIP) address of the selected Nat Gateway.

state String
subnetId String
tags Map<String>
vpcId String
filters List<Property Map>

Supporting Types

GetNatGatewayFilter

Name string

Name of the field to filter by, as defined by the underlying AWS API.

Values List<string>

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

Name string

Name of the field to filter by, as defined by the underlying AWS API.

Values []string

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

name String

Name of the field to filter by, as defined by the underlying AWS API.

values List<String>

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

name string

Name of the field to filter by, as defined by the underlying AWS API.

values string[]

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

name str

Name of the field to filter by, as defined by the underlying AWS API.

values Sequence[str]

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

name String

Name of the field to filter by, as defined by the underlying AWS API.

values List<String>

Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.