Skip to content

Data Source: awsEc2LocalGatewayRouteTable

Provides details about an EC2 Local Gateway Route Table.

This data source can prove useful when a module accepts a local gateway route table id as an input variable and needs to, for example, find the associated Outpost or Local Gateway.

Example Usage

The following example returns a specific local gateway route table ID

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 awsEc2LocalGatewayRouteTable = new cdktf.TerraformVariable(
  this,
  "aws_ec2_local_gateway_route_table",
  {}
);
new aws.dataAwsEc2LocalGatewayRouteTable.DataAwsEc2LocalGatewayRouteTable(
  this,
  "selected",
  {
    localGatewayRouteTableId: awsEc2LocalGatewayRouteTable.value,
  }
);

Argument Reference

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

  • localGatewayRouteTableId - (Optional) Local Gateway Route Table Id assigned to desired local gateway route table

  • localGatewayId - (Optional) ID of the specific local gateway route table to retrieve.

  • outpostArn - (Optional) ARN of the Outpost the local gateway route table is associated with.

  • state - (Optional) State of the local gateway route table.

  • tags - (Optional) Mapping of tags, each pair of which must exactly match a pair on the desired local gateway route table.

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

Timeouts

Configuration options:

  • read - (Default 20M)