terraform-provider-aws
terraform-provider-aws copied to clipboard
[Enhancement]: ability to return all aws_route53_zone records without specifing name or zone_id
Description
Please add the ability to return all aws_route53_zone records without specifing name or zone_id it would also be nice if you could specify a filter to search by tag without the name or zone_id provided.
Use Case:
product account has all the subdomain records when a new subdomain is created I need to update the primary operations account which is managed by a different aws account and different state file. I want to look up all the records in the product account and add them dynamically in the primary ops account state file
Affected Resource(s) and/or Data Source(s)
aws_route53_zone
Potential Terraform Configuration
retrieve all hosted zones that have a tag that matches
data "aws_route53_zone" "selected" {
provider = aws.product_account
filter {
name = "tag:Name"
values = ["*internal*"]
}
}
or the following to get everything
data "aws_route53_zone" "selected" {
provider = aws.product_account
}
References
No response
Would you like to implement a fix?
No response
Community Note
Voting for Prioritization
- Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
- Please see our prioritization guide for information on how we prioritize.
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
- If you are interested in working on this issue, please leave a comment.
- If this would be your first contribution, please review the contribution guide.
So you want to be able to search by tags and by default return everything
Maybe it need to be new type of data resource that return list instead of just 1 match
That behavior working in aws console/cli?
@travis-jorge like https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route_tables
Is there any update on this?
My use case:
Obtain a list of aws_route53_records (this is were the new datasource will be required) Loop the previous list to create a aws_route53_health_check resource for each of those records
PR has been raised for this issue https://github.com/hashicorp/terraform-provider-aws/pull/38186