[New Data Source]: aws_route53_zones
Get list (!) of hosted zones
#37465
Labels
new-data-source
Introduces a new data source.
service/route53
Issues and PRs that pertain to the route53 service.
Description
I have several hosted zones in my AWS account and some zones are sub-zones e.g.
example.com
,app1.example.com
,app2.example.com
, etc., which are managed by an "external" stack.If I want to to place a new application to my account, I want to select the "best fitting" zone, depending on the domain for the new application:
app1.example.com
example.com
example.com
I have already implented a some logic with terraform functions for selecting the zone, but for getting the list of hosted zones I'm using
external
provider, which just executesaws route53 list-hosted-zones --query HostedZones --output json
(plus some hacky workaround by converting this output to base64, because this data source supports "key/value JSON", only)It would be great, if I could use a native list data source for better stability and less external dependencies...
This new data source might be ideal for new contributers, because of existing similar list data sources and the "List" API is already being used by the existing
aws_route53_zone
(without trailing 's'):terraform-provider-aws/internal/service/route53/zone_data_source.go
Line 116 in 42ad982
Requested Resource(s) and/or Data Source(s)
(Mind the trailing 's'!)
Potential Terraform Configuration
References
Get some "inspiration" from similar data source:
AWS API:
Links to comparable data sources:
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: