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]: aws_route53_record fails when ttl is set to 0 #36411

Closed
danielmotaleite opened this issue Mar 15, 2024 · 9 comments · Fixed by cortico-aws/terraform-provider-aws#1 or #39728
Closed
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.
Milestone

Comments

@danielmotaleite
Copy link

danielmotaleite commented Mar 15, 2024

Terraform Core Version

v1.4.6

AWS Provider Version

v5.40.0

Affected Resource(s)

aws_route53_record

Expected Behavior

When ttl = 0 (zero), the resource should be created, just in line as the AWS route53 console

Actual Behavior

Error, no resource created, while the plan show OK
Can't recreate via terraform a record created manually in the AWS console

Relevant Error/Panic Output Snippet

Error: creating Route 53 Record: InvalidInput: Invalid request: Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change with [Action=UPSERT, Name=replica-1.example.com, Type=CNAME, SetIdentifier=replica-1]

Terraform Configuration Files

  resource "aws_route53_record" "this" {
       allow_overwrite = true
       name            = "replica-1.example.com"
       records         = [
           "staging-1.zzzzzzz.rds.amazonaws.com",
        ]
       set_identifier  = "replica-1"
       ttl             = 0
       type            = "CNAME"
       zone_id         = "XXXX"
    }

Steps to Reproduce

Create the tf to create a route53 record, with TTL = 0
try to apply the terraform
it should fail.
change the TTL> 0
apply the terraform
it should work now

Debug Output

No response

Panic Output

No response

Important Factoids

The AWS console didn't allow TTL in the past, but now it do allows and TTL= 0 is usefull for internal zones, as a weak load balancer, namely for RDS replica with healthchecks (route53_healthchecks), to add or remove replicas based on several checks. For that, we do not want cached results, as that may negate the healtcheck objective

References

No response

Would you like to implement a fix?

No

@danielmotaleite danielmotaleite added the bug Addresses a defect in current functionality. label Mar 15, 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/route53 Issues and PRs that pertain to the route53 service. label Mar 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 15, 2024
@justinretzolk justinretzolk changed the title [Bug]: [Bug]: aws_route53_record fails when ttl is set to 0 Mar 20, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 20, 2024
@hugo-barros
Copy link

I went to tackle this one (as I was looking for a simple issue to be my first contribution), but my acceptance test didn't pass (with same error). I wonder whether it is possible to achieve this without the plugin framework? (Instead of sdkv2).

@danielmotaleite
Copy link
Author

@hugo-barros thank you for your effort
@justinretzolk any change of helping hugo in this problem

@danielmotaleite
Copy link
Author

just to add that this makes usage of weighted DNS extremely annoying, as it force me to manual change the ttl from zero to 1 to add any new entry, and them manually reset them back to zero

│ Error: creating Route 53 Record: InvalidChangeBatch: [RRSet with DNS name readreplica-amc.staging.internal., type CNAME, SetIdentifier readreplica-amc-4 cannot be created as weighted sets must contain the same TTL., RRSet with DNS name readreplica-amc.staging.internal., type CNAME, SetIdentifier readreplica-amc-4 cannot be created as weighted sets must contain the same TTL.]

@danielmotaleite
Copy link
Author

i upgraded to v5.70. and this still exists in the latest version

cortico-aws added a commit to cortico-aws/terraform-provider-aws that referenced this issue Oct 15, 2024
Issue hashicorp#36411 aws_route53_record fails when ttl is set to 0
Copy link

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.73.0 milestone Oct 16, 2024
Copy link

This functionality has been released in v5.73.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!

@danielmotaleite
Copy link
Author

confirmed fixed with 5.73.0, i can create/update records with TTL=0

Copy link

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 Dec 16, 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
3 participants