Skip to content

Data Source: awsEc2CoipPool

Provides details about a specific EC2 Customer-Owned IP Pool.

This data source can prove useful when a module accepts a coip pool id as an input variable and needs to, for example, determine the CIDR block of that COIP Pool.

Example Usage

The following example returns a specific coip pool 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 coipPoolId = new cdktf.TerraformVariable(this, "coip_pool_id", {});
new aws.dataAwsEc2CoipPool.DataAwsEc2CoipPool(this, "selected", {
  id: coipPoolId.value,
});

Argument Reference

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

  • localGatewayRouteTableId - (Optional) Local Gateway Route Table Id assigned to desired COIP Pool

  • poolId - (Optional) ID of the specific COIP Pool to retrieve.

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

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 COIP Pool 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 COIP Pool.

In addition, the following attributes are exported:

  • arn - ARN of the COIP pool
  • poolCidrs - Set of CIDR blocks in pool

Timeouts

Configuration options:

  • read - (Default 20M)