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]: Error deleting Route53 Record. operation error. https response error StatusCode: 400 Tried to delete resource record set but it was not found #37806

Closed
el-chazmo opened this issue Jun 3, 2024 · 6 comments · Fixed by #37850
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Milestone

Comments

@el-chazmo
Copy link

Terraform Core Version

1.8.4

AWS Provider Version

5.52

Affected Resource(s)

aws_route53_record
aws_route53_zone

Expected Behavior

When performing terraform destroy - aws_route53 cname record is removed first time.

Actual Behavior

terraform destroy fails first time
│ Error: deleting Route53 Record operation error Route 53: ChangeResourceRecordSets, https response error StatusCode: 400, RequestID:xx-xx-xx, InvalidChangeBatch: [Tried to delete resource record set [name='xxxxx.', type='CNAME'] but it was not found]

terraform destroy (2nd time) succeeds

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_route53_record" "setup" {
zone_id = local.zoneid
name = "example.network.name"
type = "A"
ttl = 300
records = ["127.0.0.1"]
}

Steps to Reproduce

install hashicorp/aws latest version

NOTE: <5.51 causes no errors. Error only seen >= 5.51

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@el-chazmo el-chazmo added the bug Addresses a defect in current functionality. label Jun 3, 2024
@github-actions github-actions bot added the service/route53 Issues and PRs that pertain to the route53 service. label Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 3, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jun 4, 2024
@ewbankkit
Copy link
Contributor

@el-chazmo Thanks for raising this issue.
You example Terraform configuration above shows an aws_route53_record of type A but the error message is about a CNAME record -- could you add the configuration for the CNAME record?

@ewbankkit ewbankkit added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 4, 2024
@el-chazmo
Copy link
Author

@el-chazmo Thanks for raising this issue. You example Terraform configuration above shows an aws_route53_record of type A but the error message is about a CNAME record -- could you add the configuration for the CNAME record?

Apologies @ewbankkit The above code was incorrect, as suspected. The below is the specific code that is used to generate the Record

resource "aws_route53_record" "certificate" {
for_each = { for certificate in local.certificates : certificate.domain_name => certificate }

allow_overwrite = true
name = each.value.name
type = each.value.type
zone_id = aws_route53_zone.zone.zone_id
records = [each.value.record]
ttl = 60
}

Terraform destroy (1st) shows: -

module.dns.aws_route53_record.certificate["*.example"]: Destroying... [id=XXXXX__yyyyy.example._CNAME]
module.dns.aws_route53_record.certificate["example"]: Destroying... [id=XXXXX__yyyyy.example._CNAME]

│ Error: deleting Route53 Record (XXXXX__yyyyy.example._CNAME): operation error Route 53: ChangeResourceRecordSets, https response error StatusCode: 400, RequestID: xxx-xxx-xxx, InvalidChangeBatch: [Tried to delete resource record set [name='_yyyyy.example.', type='CNAME'] but it was not found]

Terraform destroy (2nd) shows: -

module.dns.aws_route53_zone.zone: Destroying... [id=XXXXX]
module.dns.aws_route53_zone.zone: Destruction complete after 46s

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 5, 2024
Copy link

github-actions bot commented Jun 6, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.53.0 milestone Jun 6, 2024
Copy link

github-actions bot commented Jun 7, 2024

This functionality has been released in v5.53.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Jul 8, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants