Skip to content

Data Source: awsInternetGateway

awsInternetGateway provides details about a specific Internet Gateway.

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
/*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK.
You can read more about this at https://cdk.tf/variables*/
const vpcId = new cdktf.TerraformVariable(this, "vpc_id", {});
new aws.dataAwsInternetGateway.DataAwsInternetGateway(this, "default", {
  filter: [
    {
      name: "attachment.vpc-id",
      values: [vpcId.value],
    },
  ],
});

Argument Reference

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

  • internetGatewayId - (Optional) ID of the specific Internet Gateway to retrieve.

  • tags - (Optional) Map of tags, each pair of which must exactly match a pair on the desired Internet 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 Internet Gateway will be selected if any one of the given values matches.

Attributes Reference

  • arn - ARN of the Internet Gateway.

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 Internet Gateway.

attachments are also exported with the following attributes, when there are relevants: Each attachment supports the following:

  • ownerId - ID of the AWS account that owns the internet gateway.
  • state - Current state of the attachment between the gateway and the VPC. Present only if a VPC is attached
  • vpcId - ID of an attached VPC.

Timeouts

Configuration options:

  • read - (Default 20M)