Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to create new domains via aws_route53domains_registered_domain #37670

Open
alexikaruna opened this issue May 23, 2024 · 2 comments · May be fixed by #37885
Open

[Bug]: Unable to create new domains via aws_route53domains_registered_domain #37670

alexikaruna opened this issue May 23, 2024 · 2 comments · May be fixed by #37885
Labels
bug Addresses a defect in current functionality. service/route53domains Issues and PRs that pertain to the route53domains service.

Comments

@alexikaruna
Copy link

alexikaruna commented May 23, 2024

Terraform Core Version

1.8.1

AWS Provider Version

5.50.0

Affected Resource(s)

aws_route53domains_registered_domain

Expected Behavior

When trying to create a new domain (i.e. does not exist in Route53 already), we should be able to. This is an example from the plan:

# aws_route53domains_registered_domain.domain["my-company-wifi.com"] will be created
+ resource "aws_route53domains_registered_domain" "domain" {
      + abuse_contact_email = (known after apply)
      + abuse_contact_phone = (known after apply)
      + admin_privacy       = true
      + auto_renew          = true
      + billing_privacy     = true
      + creation_date       = (known after apply)
      + domain_name         = "my-company-wifi.com"
      + expiration_date     = (known after apply)
      + id                  = (known after apply)
      + registrant_privacy  = true
      + registrar_name      = (known after apply)
      + registrar_url       = (known after apply)
      + reseller            = (known after apply)
      + status_list         = (known after apply)
      + tags_all            = (known after apply)
      + tech_privacy        = true
      + transfer_lock       = true
      + updated_date        = (known after apply)
      + whois_server        = (known after apply)
    }

Actual Behavior

The new domain does not get created and we get an error instead.

Relevant Error/Panic Output Snippet

aws_route53domains_registered_domain.domain["my-company-wifi.com"]: Creating...

│ Error: reading Route 53 Domains Domain (my-company-wifi.com): couldn't find resource

│   with aws_route53domains_registered_domain.domain["my-company-wifi.com"],
│   on domain_registrations.tf line 826, in resource "aws_route53domains_registered_domain" "domain":
│  826: resource "aws_route53domains_registered_domain" "domain" {

Terraform Configuration Files

terraform {
  required_version = "= 1.8.1"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "= 5.50.0"
    }
  }
}

locals {
  domains = {
    "my-company-wifi.com" = []
  }
}

resource "aws_route53domains_registered_domain" "domain" {
  for_each = local.domains

  domain_name   = each.key
  auto_renew    = true
  transfer_lock = true

  dynamic "name_server" {
    for_each = each.value
    content {
      name = name_server.value
    }
  }
}

Steps to Reproduce

Run plan/apply

Debug Output

No response

Panic Output

No response

Important Factoids

I see in https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/route53domains/registered_domain.go#L268 that findDomainDetailByName is called which will return an error of the domain record is not found. I suspect that resourceRegisteredDomainRead (in the same file) should be called instead since it accounts for IsNewResource when there is a NotFound error.

References

No response

Would you like to implement a fix?

No

@alexikaruna alexikaruna added the bug Addresses a defect in current functionality. label May 23, 2024
Copy link

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.

@github-actions github-actions bot added the service/route53domains Issues and PRs that pertain to the route53domains service. label May 23, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 23, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 24, 2024
@davidmohar
Copy link

@alexikaruna we stumbled into the same problem and as I investigated, it seems like this was actually intentional and doesn't look like a bug. I've opened #37885 with my proposed changes, let's see if there's any interest in accepting this feature. I've managed to test pretty much everything except registering a new domain. Would appreciate some help here if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/route53domains Issues and PRs that pertain to the route53domains service.
Projects
None yet
3 participants