Skip to content

Data Source: awsEc2ManagedPrefixList

awsEc2ManagedPrefixList provides details about a specific AWS prefix list or customer-managed prefix list in the current region.

Example Usage

Find the regional DynamoDB prefix list

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsRegionCurrent = new aws.dataAwsRegion.DataAwsRegion(
  this,
  "current",
  {}
);
new aws.dataAwsEc2ManagedPrefixList.DataAwsEc2ManagedPrefixList(
  this,
  "example",
  {
    name: `com.amazonaws.\${${dataAwsRegionCurrent.name}}.dynamodb`,
  }
);

Find a managed prefix list using filters

/*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.dataAwsEc2ManagedPrefixList.DataAwsEc2ManagedPrefixList(
  this,
  "example",
  {
    filter: [
      {
        name: "prefix-list-name",
        values: ["my-prefix-list"],
      },
    ],
  }
);

Argument Reference

The arguments of this data source act as filters for querying the available prefix lists. The given filters must match exactly one prefix list whose data will be exported as attributes.

  • id - (Optional) ID of the prefix list to select.
  • name - (Optional) Name of the prefix list to select.
  • filter - (Optional) Configuration block(s) for filtering. Detailed below.

filter Configuration Block

The following arguments are supported by the filter configuration block:

  • name - (Required) Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
  • values - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - ID of the selected prefix list.
  • arn - ARN of the selected prefix list.
  • name - Name of the selected prefix list.
  • entries - Set of entries in this prefix list. Each entry is an object with cidr and description.
  • ownerId - Account ID of the owner of a customer-managed prefix list, or aws otherwise.
  • addressFamily - Address family of the prefix list. Valid values are iPv4 and iPv6.
  • maxEntries - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
  • tags - Map of tags assigned to the resource.

Timeouts

Configuration options:

  • read - (Default 20M)