Skip to content

Conversation

@bentsku
Copy link
Contributor

@bentsku bentsku commented Jan 16, 2026

Motivation

We got a customer report for UPDATE support for the.AWS::Route53:RecordSet resource provider.

I've added a bit more CREATE test around the operation, split the tests for the different resources and added one update test. Luckily, it is actually pretty simple because the operation used for ResourceRecordSet does support creation, deletion and update all at once, so we do not need to fully handle the update logic in the provider itself.

The only special case is SetIdentifier, because you cannot update a value that has a different SetIdentifier, it has to be deleted and recreated (as it is the identifier value to properly update a RecordSet when you have multiple).

Changes

  • refactor Route53 tests to be in the route53 test module for better test detection
  • add more RecordSet CloudFormation tests, especially with multiple values and containing AliasTarget
  • add support for the update operation and a test for it

Tests

Related

@bentsku bentsku added this to the 4.13 milestone Jan 16, 2026
@bentsku bentsku self-assigned this Jan 16, 2026
@bentsku bentsku added aws:route53 Amazon Route 53 semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Test Results - Preflight, Unit

23 084 tests   21 225 ✅  6m 8s ⏱️
     1 suites   1 859 💤
     1 files         0 ❌

Results for commit fe6d14a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Test Results (amd64) - Acceptance

7 tests   5 ✅  3m 1s ⏱️
1 suites  2 💤
1 files    0 ❌

Results for commit fe6d14a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

LocalStack Community integration with Pro

    2 files      2 suites   1h 58m 33s ⏱️
5 178 tests 4 790 ✅ 388 💤 0 ❌
5 180 runs  4 790 ✅ 390 💤 0 ❌

Results for commit fe6d14a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 38m 47s ⏱️
5 599 tests 5 041 ✅ 558 💤 0 ❌
5 605 runs  5 041 ✅ 564 💤 0 ❌

Results for commit fe6d14a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Test Results - Alternative Providers

582 tests   322 ✅  17m 14s ⏱️
  1 suites  260 💤
  1 files      0 ❌

Results for commit fe6d14a.

♻️ This comment has been updated with latest results.

@bentsku bentsku force-pushed the route53-record-set-cfn-update branch from 4815318 to fe6d14a Compare January 27, 2026 18:34
@bentsku bentsku marked this pull request as ready for review January 28, 2026 09:39
@bentsku bentsku modified the milestones: 4.13, 4.14 Jan 28, 2026
@simonrw
Copy link
Contributor

simonrw commented Jan 29, 2026

The only special case is SetIdentifier, because you cannot update a value that has a different SetIdentifier, it has to be deleted and recreated (as it is the identifier value to properly update a RecordSet when you have multiple).

Interesting, but this is not a createOnlyProperty 🤔 either this is an issue with the spec (not impossible) or a weird create/delete process that has to happen in the resource provider.

Copy link
Contributor Author

bentsku commented Jan 29, 2026

Yeah, I think this is because there is no real identifier for RecordSet, the SetIdentifier is an optional field depending on the type of "routing policy" you choose, which influence the shape of the RecordSet field (presence of Weight, etc, the spec is not really well thought out), the type is only inferred from the presence of certain fields. You only have the SetIdentifier field when the RecordSet can have multiple entries.

Also, to delete a RecordSet (from the CLI for example), technically you need to provide all the fields that the RecordSet currently has, I suppose to do equality checks. It is a weird operation in itself, even without CloudFormation

See this about the routing policy / how to influence the shape: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html

Also, you can see how the Id field is the same for all the RecordSet, it is a bit of a weird resource 😅 I checked that against AWS, I could add more tests for it, but could confirm.

Copy link
Contributor

@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this change, and going the extra mile to improve the create behaviour as well!

rr_sets = aws_client.route53.list_resource_record_sets(HostedZoneId=hosted_zone_id)
snapshot.match("record-sets-update-alias-target", rr_sets)

parameters["BucketTwoSetIdentifier"] = "region-3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea: since you say the SetIdentifier has to recreate the record set completely, yet it's not listed in the CFn createOnlyParameters, it would be useful to use the capture_per_resource_events fixture and assert the results (after filtering) to see if the behaviour on CFn is as if it were a createOnlyProperty or if it is indeed handled in the resource provider.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just done this and I find (time goes down):

- CREATE_IN_PROGRESS
- CREATE_COMPLETE
- UPDATE_IN_PROGRESS
- UPDATE_COMPLETE
- UPDATE_IN_PROGRESS
- UPDATE_COMPLETE
- UPDATE_IN_PROGRESS
- UPDATE_COMPLETE

so yes it looks like it's handled in the resource provider 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking it for me, very much appreciated 🙏 I'll merge so that we can give the fix to the customer, but I'll keep this trick in mind next time!

@bentsku bentsku merged commit 37780be into main Jan 29, 2026
46 of 48 checks passed
@bentsku bentsku deleted the route53-record-set-cfn-update branch January 29, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:route53 Amazon Route 53 docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants