This resource can be useful for getting back a list of managed prefix list ids to be referenced elsewhere.
The following returns all managed prefix lists filtered by tags
data "aws_ec2_managed_prefix_lists" "test_env" {
tags = {
Env = "test"
}
}
data "aws_ec2_managed_prefix_list" "test_env" {
count = length(data.aws_ec2_managed_prefix_lists.test_env.ids)
id = tolist(data.aws_ec2_managed_prefix_lists.test_env.ids)[count.index]
}
filter
- (Optional) Custom filter block as described below.tags
- (Optional) Map of tags, each pair of which must exactly match
a pair on the desired .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 managed prefix list will be selected if any one of the given values matches.This data source exports the following attributes in addition to the arguments above:
id
- AWS Region.ids
- List of all the managed prefix list ids found.read
- (Default 20m
)