hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

[Enhancement]: Data source to retrieve all route53 registered domains #29461

Open nitrocode opened 1 year ago

nitrocode commented 1 year ago

Description

As far as I understand it, the route53 registrar domains must be clickops'ed before they can be managed by Terraform.

At the moment, I'm creating a manual list of domains within terraform.

The current workflow is

  1. Clickops a new domain
  2. Append a local in terraform
  3. Apply the terraform to get the appropriate admin contact and other details

We can eliminate step 2 if we had a data source that could retrieve all the registrar domains.

This is available in the API and from the CLI.

✗ aws route53domains list-domains --query 'Domains[].DomainName'
[
    "domain1.com",
    "domain2.com",
    "domain3.com",
]

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

data "aws_route53domains_registered_domains" "default" {}

# Registered Domains
resource "aws_route53domains_registered_domain" "default" {
  for_each = toset(data.aws_route53domains_registered_domains.default.domains)

  domain_name = each.value

  auto_renew    = true
  admin_privacy = true

  # ...
}

References

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue