Skip to content

Data Source: awsEc2LocalGateway

Provides details about an EC2 Local Gateway.

Example Usage

The following example shows how one might accept a local gateway id as a variable.

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 localGatewayId = new cdktf.TerraformVariable(
  this,
  "local_gateway_id",
  {}
);
new aws.dataAwsEc2LocalGateway.DataAwsEc2LocalGateway(this, "selected", {
  id: localGatewayId.value,
});

Argument Reference

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

  • filter - (Optional) Custom filter block as described below.

  • id - (Optional) Id of the specific Local Gateway to retrieve.

  • state - (Optional) Current state of the desired Local Gateway. Can be either "pending" or "available".

  • tags - (Optional) Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

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. A Local Gateway will be selected if any one of the given values matches.

Attributes Reference

All of the argument attributes except filter blocks 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 Local Gateway.

The following attributes are additionally exported:

  • outpostArn - ARN of Outpost
  • ownerId - AWS account identifier that owns the Local Gateway.
  • state - State of the local gateway.

Timeouts

Configuration options:

  • read - (Default 20M)