Skip to content

Conversation

@tabito-hara
Copy link
Contributor

@tabito-hara tabito-hara commented Nov 27, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

This PR adds the enable_accelerated_recovery argument/attribute to the aws_route53_zone resource and data source.

AWS API behavior and Provider implementation

  • enable_accelerated_recovery can be modified using the UpdateHostedZoneFeatures API.

    • Since this field is not included in the input parameters of the CreateHostedZone API, the provider calls UpdateHostedZoneFeatures after creating the resource to set this value.
    • Updating enable_accelerated_recovery may take a few minutes.
      • A waiter is implemented for this operation.
        • The state transitions are defined in the AWS SDK Go v2.
      • A new source file is introduced to contain the handling logic for AcceleratedRecoveryStatus, similar to how change_info.go handles ChangeStatus.
  • Hosted zones with enable_accelerated_recovery enabled cannot be deleted.

    • During deletion, if enable_accelerated_recovery is enabled, it is first disabled before the hosted zone is deleted.
    • The acceptance test added in this PR also covers the deletion of a hosted zone with accelerated recovery enabled.

Data Source

  • enable_accelerated_recovery is also added to the data source.

Relations

Closes #45279

References

https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHostedZoneFeatures.html
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/accelerated-recovery.html#accelerated-recovery-enable

Output from Acceptance Testing

Resource

One test failed, but it does not appear to be related to this PR's fix.

$ make testacc TESTS='TestAccRoute53Zone_' PKG=route53 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_route53_zone-add_enable_accelerated_recovery 🌿...
TF_ACC=1 go1.24.10 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53Zone_'  -timeout 360m -vet=off
2025/11/28 01:32:41 Creating Terraform AWS Provider (SDKv2-style)...
2025/11/28 01:32:41 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccRoute53Zone_basic
=== PAUSE TestAccRoute53Zone_basic
=== RUN   TestAccRoute53Zone_disappears
=== PAUSE TestAccRoute53Zone_disappears
=== RUN   TestAccRoute53Zone_multiple
=== PAUSE TestAccRoute53Zone_multiple
=== RUN   TestAccRoute53Zone_comment
=== PAUSE TestAccRoute53Zone_comment
=== RUN   TestAccRoute53Zone_delegationSetID
=== PAUSE TestAccRoute53Zone_delegationSetID
=== RUN   TestAccRoute53Zone_forceDestroy
=== PAUSE TestAccRoute53Zone_forceDestroy
=== RUN   TestAccRoute53Zone_ForceDestroy_trailingPeriod
=== PAUSE TestAccRoute53Zone_ForceDestroy_trailingPeriod
=== RUN   TestAccRoute53Zone_tags
=== PAUSE TestAccRoute53Zone_tags
=== RUN   TestAccRoute53Zone_VPC_single
=== PAUSE TestAccRoute53Zone_VPC_single
=== RUN   TestAccRoute53Zone_VPC_multiple
=== PAUSE TestAccRoute53Zone_VPC_multiple
=== RUN   TestAccRoute53Zone_VPC_updates
=== PAUSE TestAccRoute53Zone_VPC_updates
=== RUN   TestAccRoute53Zone_VPC_single_forceDestroy
=== PAUSE TestAccRoute53Zone_VPC_single_forceDestroy
=== RUN   TestAccRoute53Zone_escapedCharacter
=== PAUSE TestAccRoute53Zone_escapedCharacter
=== RUN   TestAccRoute53Zone_classlessDelegation
=== PAUSE TestAccRoute53Zone_classlessDelegation
=== RUN   TestAccRoute53Zone_escapedSlash
=== PAUSE TestAccRoute53Zone_escapedSlash
=== RUN   TestAccRoute53Zone_escapedSpace
=== PAUSE TestAccRoute53Zone_escapedSpace
=== RUN   TestAccRoute53Zone_enableAcceleratedRecovery
=== PAUSE TestAccRoute53Zone_enableAcceleratedRecovery
=== CONT  TestAccRoute53Zone_basic
=== CONT  TestAccRoute53Zone_VPC_multiple
=== CONT  TestAccRoute53Zone_forceDestroy
=== CONT  TestAccRoute53Zone_comment
=== CONT  TestAccRoute53Zone_multiple
=== CONT  TestAccRoute53Zone_delegationSetID
=== CONT  TestAccRoute53Zone_disappears
=== CONT  TestAccRoute53Zone_tags
=== CONT  TestAccRoute53Zone_VPC_single
=== CONT  TestAccRoute53Zone_classlessDelegation
=== CONT  TestAccRoute53Zone_enableAcceleratedRecovery
=== CONT  TestAccRoute53Zone_escapedSpace
=== CONT  TestAccRoute53Zone_escapedSlash
=== CONT  TestAccRoute53Zone_ForceDestroy_trailingPeriod
=== CONT  TestAccRoute53Zone_VPC_single_forceDestroy
=== CONT  TestAccRoute53Zone_escapedCharacter
=== CONT  TestAccRoute53Zone_VPC_updates
=== NAME  TestAccRoute53Zone_disappears
    zone_test.go:80: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: reading Route53 Hosted Zone (Z00738881X7QV0ODCR1OK) before deletion: couldn't find resource
        
--- FAIL: TestAccRoute53Zone_disappears (90.09s)
--- PASS: TestAccRoute53Zone_classlessDelegation (94.52s)
--- PASS: TestAccRoute53Zone_escapedSlash (95.18s)
--- PASS: TestAccRoute53Zone_multiple (97.24s)
--- PASS: TestAccRoute53Zone_escapedSpace (98.40s)
--- PASS: TestAccRoute53Zone_escapedCharacter (98.44s)
--- PASS: TestAccRoute53Zone_delegationSetID (100.94s)
--- PASS: TestAccRoute53Zone_basic (103.39s)
--- PASS: TestAccRoute53Zone_comment (109.37s)
--- PASS: TestAccRoute53Zone_tags (123.31s)
--- PASS: TestAccRoute53Zone_forceDestroy (220.49s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (220.58s)
--- PASS: TestAccRoute53Zone_VPC_single (251.25s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (296.13s)
--- PASS: TestAccRoute53Zone_VPC_multiple (312.64s)
--- PASS: TestAccRoute53Zone_VPC_updates (479.06s)
--- PASS: TestAccRoute53Zone_enableAcceleratedRecovery (1523.37s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/route53    1527.731s
FAIL
make: *** [testacc] Error 1

Data Source

$ make testacc TESTS='TestAccRoute53ZoneDataSource_' PKG=route53
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_route53_zone-add_enable_accelerated_recovery 🌿...
TF_ACC=1 go1.24.10 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53ZoneDataSource_'  -timeout 360m -vet=off
2025/11/28 02:03:35 Creating Terraform AWS Provider (SDKv2-style)...
2025/11/28 02:03:35 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccRoute53ZoneDataSource_id
=== PAUSE TestAccRoute53ZoneDataSource_id
=== RUN   TestAccRoute53ZoneDataSource_name
=== PAUSE TestAccRoute53ZoneDataSource_name
=== RUN   TestAccRoute53ZoneDataSource_name_idEmptyString
=== PAUSE TestAccRoute53ZoneDataSource_name_idEmptyString
=== RUN   TestAccRoute53ZoneDataSource_tags
=== PAUSE TestAccRoute53ZoneDataSource_tags
=== RUN   TestAccRoute53ZoneDataSource_tagsOnly
=== PAUSE TestAccRoute53ZoneDataSource_tagsOnly
=== RUN   TestAccRoute53ZoneDataSource_vpc
=== PAUSE TestAccRoute53ZoneDataSource_vpc
=== RUN   TestAccRoute53ZoneDataSource_vpcOnly
=== PAUSE TestAccRoute53ZoneDataSource_vpcOnly
=== RUN   TestAccRoute53ZoneDataSource_serviceDiscovery
=== PAUSE TestAccRoute53ZoneDataSource_serviceDiscovery
=== CONT  TestAccRoute53ZoneDataSource_id
=== CONT  TestAccRoute53ZoneDataSource_tagsOnly
=== CONT  TestAccRoute53ZoneDataSource_name_idEmptyString
=== CONT  TestAccRoute53ZoneDataSource_tags
=== CONT  TestAccRoute53ZoneDataSource_name
=== CONT  TestAccRoute53ZoneDataSource_vpcOnly
=== CONT  TestAccRoute53ZoneDataSource_vpc
=== CONT  TestAccRoute53ZoneDataSource_serviceDiscovery
--- PASS: TestAccRoute53ZoneDataSource_name (89.46s)
--- PASS: TestAccRoute53ZoneDataSource_name_idEmptyString (89.47s)
--- PASS: TestAccRoute53ZoneDataSource_id (89.47s)
--- PASS: TestAccRoute53ZoneDataSource_tagsOnly (92.66s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (119.84s)
--- PASS: TestAccRoute53ZoneDataSource_tags (225.95s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (225.96s)
--- PASS: TestAccRoute53ZoneDataSource_vpcOnly (228.17s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    232.444s

@github-actions
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@tabito-hara tabito-hara changed the title [Enhancement] aws_route53_zone: Add enable_accelerated recovery argument [Enhancement] aws_route53_zone: Add enable_accelerated_recovery argument Nov 27, 2025
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/route53 Issues and PRs that pertain to the route53 service. size/L Managed by automation to categorize the size of a PR. labels Nov 27, 2025
@tabito-hara tabito-hara marked this pull request as ready for review November 27, 2025 17:38
@tabito-hara tabito-hara requested a review from a team as a code owner November 27, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. service/route53 Issues and PRs that pertain to the route53 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route 53 accelerated recovery in public hosted zone

1 participant