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

r/aws_route53_zone: prevent re-creation with uppercase name #36563

Merged
merged 1 commit into from Mar 26, 2024

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Mar 25, 2024

Description

This change handles normalizing the name argument such that the value returned from the Route53 API matches what is stored in state. Previously, if the name argument included an uppercase letter a persistent difference would be present, causing the resource to be re-created.

Relations

Closes #35022

References

Output from Acceptance Testing

% make testacc PKG=route53 TESTS=TestAccRoute53Zone_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53Zone_'  -timeout 360m

--- PASS: TestAccRoute53Zone_disappears (57.95s)
--- PASS: TestAccRoute53Zone_delegationSetID (65.40s)
--- PASS: TestAccRoute53Zone_basic (66.34s)
--- PASS: TestAccRoute53Zone_VPC_single (70.98s)
--- PASS: TestAccRoute53Zone_comment (71.97s)
--- PASS: TestAccRoute53Zone_multiple (74.73s)
--- PASS: TestAccRoute53Zone_tags (76.63s)
--- PASS: TestAccRoute53Zone_VPC_multiple (143.04s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (190.01s)
--- PASS: TestAccRoute53Zone_VPC_updates (212.37s)
--- PASS: TestAccRoute53Zone_forceDestroy (258.91s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (274.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    279.439
% make testacc PKG=route53 TESTS=TestAccRoute53ZoneDataSource_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53ZoneDataSource_'  -timeout 360m

--- PASS: TestAccRoute53ZoneDataSource_id (45.26s)
--- PASS: TestAccRoute53ZoneDataSource_name (48.35s)
--- PASS: TestAccRoute53ZoneDataSource_tags (65.21s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (83.68s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (102.34s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    107.890s

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/route53 Issues and PRs that pertain to the route53 service. labels Mar 25, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 25, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

This change handles normalizing the `name` argument such that the value returned from the Route53 API matches what is stored in state. Previously, if the `name` argument included an uppercase letter a persistent difference would be present, causing the resource to be re-created.

```console
% make testacc PKG=route53 TESTS=TestAccRoute53Zone_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53Zone_'  -timeout 360m

--- PASS: TestAccRoute53Zone_disappears (57.95s)
--- PASS: TestAccRoute53Zone_delegationSetID (65.40s)
--- PASS: TestAccRoute53Zone_basic (66.34s)
--- PASS: TestAccRoute53Zone_VPC_single (70.98s)
--- PASS: TestAccRoute53Zone_comment (71.97s)
--- PASS: TestAccRoute53Zone_multiple (74.73s)
--- PASS: TestAccRoute53Zone_tags (76.63s)
--- PASS: TestAccRoute53Zone_VPC_multiple (143.04s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (190.01s)
--- PASS: TestAccRoute53Zone_VPC_updates (212.37s)
--- PASS: TestAccRoute53Zone_forceDestroy (258.91s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (274.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    279.439
```

```console
% make testacc PKG=route53 TESTS=TestAccRoute53ZoneDataSource_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/route53/... -v -count 1 -parallel 20 -run='TestAccRoute53ZoneDataSource_'  -timeout 360m

--- PASS: TestAccRoute53ZoneDataSource_id (45.26s)
--- PASS: TestAccRoute53ZoneDataSource_name (48.35s)
--- PASS: TestAccRoute53ZoneDataSource_tags (65.21s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (83.68s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (102.34s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    107.890s
```
@jar-b jar-b force-pushed the b-route53_zone-name-casing branch from b8d13e8 to 2f6ab11 Compare March 25, 2024 19:01
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@jar-b jar-b merged commit d7093af into main Mar 26, 2024
37 checks passed
@jar-b jar-b deleted the b-route53_zone-name-casing branch March 26, 2024 12:56
@github-actions github-actions bot added this to the v5.43.0 milestone Mar 26, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 28, 2024
Copy link

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

I'm going to lock this pull request 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 related to this change, 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 Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/route53 Issues and PRs that pertain to the route53 service. size/S 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
2 participants