Allow data source ec2_managed_prefix_list
to return more than one match
#20636
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
new-data-source
Introduces a new data source.
service/ec2
Issues and PRs that pertain to the ec2 service.
Community Note
Description
I was trying to refer organization-wide shared prefix lists by filtering them by name. Unfortunately, my attempts failed with
│ Error: more than 1 prefix list matched the given criteria
New or Affected Resource(s)
data.aws_ec2_managed_prefix_list
Potential Terraform Configuration
This will match two production-related prefix lists.
References
Underlying API supports enumerating more than one resource at time. See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeManagedPrefixLists.html .
Same works with aws-cli:
aws ec2 describe-managed-prefix-lists --filter "Name=prefix-list-name,Values=???_$ENVIRONMENT" --filter "Name=owner-id,Values=$OWNER" | grep -c "PrefixListArn"
The text was updated successfully, but these errors were encountered: