Skip to content

Data Source: awsNatGateway

Provides details about a specific Nat Gateway.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsNatGateway.DataAwsNatGateway(this, "default", {
  subnetId: "${aws_subnet.public.id}",
});

Usage with tags:

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsNatGateway.DataAwsNatGateway(this, "default", {
  subnetId: "${aws_subnet.public.id}",
  tags: {
    Name: "gw NAT",
  },
});

Argument Reference

The arguments of this data source act as filters for querying the available Nat Gateways in the current region. The given filters must match exactly one Nat Gateway whose data will be exported as attributes.

  • id - (Optional) ID of the specific Nat Gateway to retrieve.
  • subnetId - (Optional) ID of subnet that the Nat Gateway resides in.
  • vpcId - (Optional) ID of the VPC that the Nat Gateway resides in.
  • state - (Optional) State of the NAT gateway (pending | failed | available | deleting | deleted ).
  • tags - (Optional) Map of tags, each pair of which must exactly match a pair on the desired Nat Gateway.
  • filter - (Optional) Custom filter block as described below.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

  • name - (Required) Name of the field to filter by, as defined by the underlying AWS API.
  • values - (Required) Set of values that are accepted for the given field. An Nat Gateway will be selected if any one of the given values matches.

Attributes Reference

All of the argument attributes except filter block are also exported as result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for the selected Nat Gateway.

addresses are also exported with the following attributes, when they are relevant: Each attachment supports the following:

  • allocationId - ID of the EIP allocated to the selected Nat Gateway.
  • connectivityType - Connectivity type of the NAT Gateway.
  • networkInterfaceId - The ID of the ENI allocated to the selected Nat Gateway.
  • privateIp - Private Ip address of the selected Nat Gateway.
  • publicIp - Public Ip (EIP) address of the selected Nat Gateway.

Timeouts

Configuration options:

  • read - (Default 20M)