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: fix invalid name_servers values #37685

Merged
merged 1 commit into from
May 24, 2024

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented May 24, 2024

Description

The migration of route53 to AWS SDK V2 introduced a regression which caused the name_servers attribute to be set to a list of record sets, rather than a list of name servers. This change returns the value to a list of name servers.

Given a minimal configuration with an internal VPC and associated hosted zone, the name_servers output from v5.51.0 is:

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "jb-test.internal.",
  "jb-test.internal.",
])

After this patch is applied:

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "ns-0.awsdns-00.com.",
  "ns-1024.awsdns-00.org.",
  "ns-1536.awsdns-00.co.uk.",
  "ns-512.awsdns-00.net.",
])

Relations

Closes #37681
Relates #37510

References

Output from Acceptance Testing

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

=== NAME  TestAccRoute53ZoneAssociation_crossAccountAndRegion
    zone_association_test.go:194: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccountAndRegion (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_serviceDiscovery
=== NAME  TestAccRoute53ZoneAssociation_crossAccount
    zone_association_test.go:132: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccount (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_vpc
--- PASS: TestAccRoute53Zone_delegationSetID (84.84s)
=== CONT  TestAccRoute53ZoneAssociation_Disappears_vpc
--- PASS: TestAccRoute53Zone_disappears (100.18s)
=== CONT  TestAccRoute53ZoneAssociation_disappears
--- PASS: TestAccRoute53ZoneDataSource_name (104.72s)
--- PASS: TestAccRoute53Zone_tags (106.97s)
--- PASS: TestAccRoute53Zone_comment (109.89s)
--- PASS: TestAccRoute53ZoneDataSource_id (112.29s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (114.20s)
--- PASS: TestAccRoute53Zone_multiple (115.26s)
--- PASS: TestAccRoute53Zone_basic (118.37s)
--- PASS: TestAccRoute53Zone_VPC_single (143.43s)
--- PASS: TestAccRoute53ZoneDataSource_tags (146.51s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (152.61s)
--- PASS: TestAccRoute53Zone_VPC_multiple (195.22s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (213.78s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_zone (220.95s)
--- PASS: TestAccRoute53Zone_VPC_updates (267.84s)
--- PASS: TestAccRoute53Zone_forceDestroy (268.90s)
--- PASS: TestAccRoute53ZoneAssociation_basic (270.54s)
--- PASS: TestAccRoute53ZoneAssociation_crossRegion (274.63s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (295.21s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_vpc (242.63s)
--- PASS: TestAccRoute53ZoneAssociation_disappears (231.23s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    336.544s

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/XS Managed by automation to categorize the size of a PR. service/route53 Issues and PRs that pertain to the route53 service. labels May 24, 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 May 24, 2024
@jar-b jar-b added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label May 24, 2024
The migration of route53 to AWS SDK V2 introduced a regression which caused the `name_servers` attribute to be set to a list of record sets, rather than a list of name servers. This change returns the value to a list of name servers.

Given a minimal configuration with an internal VPC and associated hosted zone, the `name_servers` output from `v5.51.0` is:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "jb-test.internal.",
  "jb-test.internal.",
])
```

After this patch is applied:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "ns-0.awsdns-00.com.",
  "ns-1024.awsdns-00.org.",
  "ns-1536.awsdns-00.co.uk.",
  "ns-512.awsdns-00.net.",
])
```

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

=== NAME  TestAccRoute53ZoneAssociation_crossAccountAndRegion
    zone_association_test.go:194: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccountAndRegion (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_serviceDiscovery
=== NAME  TestAccRoute53ZoneAssociation_crossAccount
    zone_association_test.go:132: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccount (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_vpc
--- PASS: TestAccRoute53Zone_delegationSetID (84.84s)
=== CONT  TestAccRoute53ZoneAssociation_Disappears_vpc
--- PASS: TestAccRoute53Zone_disappears (100.18s)
=== CONT  TestAccRoute53ZoneAssociation_disappears
--- PASS: TestAccRoute53ZoneDataSource_name (104.72s)
--- PASS: TestAccRoute53Zone_tags (106.97s)
--- PASS: TestAccRoute53Zone_comment (109.89s)
--- PASS: TestAccRoute53ZoneDataSource_id (112.29s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (114.20s)
--- PASS: TestAccRoute53Zone_multiple (115.26s)
--- PASS: TestAccRoute53Zone_basic (118.37s)
--- PASS: TestAccRoute53Zone_VPC_single (143.43s)
--- PASS: TestAccRoute53ZoneDataSource_tags (146.51s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (152.61s)
--- PASS: TestAccRoute53Zone_VPC_multiple (195.22s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (213.78s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_zone (220.95s)
--- PASS: TestAccRoute53Zone_VPC_updates (267.84s)
--- PASS: TestAccRoute53Zone_forceDestroy (268.90s)
--- PASS: TestAccRoute53ZoneAssociation_basic (270.54s)
--- PASS: TestAccRoute53ZoneAssociation_crossRegion (274.63s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (295.21s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_vpc (242.63s)
--- PASS: TestAccRoute53ZoneAssociation_disappears (231.23s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    336.544s
```
@jar-b jar-b force-pushed the b-route53_zone-invalid-name-servers branch from 4abb4b6 to 1b55f97 Compare May 24, 2024 13:43
@jar-b jar-b marked this pull request as ready for review May 24, 2024 14:06
Copy link
Member

@YakDriver YakDriver 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 f528108 into main May 24, 2024
44 checks passed
@jar-b jar-b deleted the b-route53_zone-invalid-name-servers branch May 24, 2024 14:57
@github-actions github-actions bot added this to the v5.52.0 milestone May 24, 2024
github-actions bot pushed a commit that referenced this pull request May 24, 2024
Copy link

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

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 30, 2024
trevorbonas pushed a commit to Bit-Quill/terraform-provider-aws that referenced this pull request Jun 4, 2024
The migration of route53 to AWS SDK V2 introduced a regression which caused the `name_servers` attribute to be set to a list of record sets, rather than a list of name servers. This change returns the value to a list of name servers.

Given a minimal configuration with an internal VPC and associated hosted zone, the `name_servers` output from `v5.51.0` is:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "jb-test.internal.",
  "jb-test.internal.",
])
```

After this patch is applied:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "ns-0.awsdns-00.com.",
  "ns-1024.awsdns-00.org.",
  "ns-1536.awsdns-00.co.uk.",
  "ns-512.awsdns-00.net.",
])
```

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

=== NAME  TestAccRoute53ZoneAssociation_crossAccountAndRegion
    zone_association_test.go:194: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccountAndRegion (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_serviceDiscovery
=== NAME  TestAccRoute53ZoneAssociation_crossAccount
    zone_association_test.go:132: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccount (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_vpc
--- PASS: TestAccRoute53Zone_delegationSetID (84.84s)
=== CONT  TestAccRoute53ZoneAssociation_Disappears_vpc
--- PASS: TestAccRoute53Zone_disappears (100.18s)
=== CONT  TestAccRoute53ZoneAssociation_disappears
--- PASS: TestAccRoute53ZoneDataSource_name (104.72s)
--- PASS: TestAccRoute53Zone_tags (106.97s)
--- PASS: TestAccRoute53Zone_comment (109.89s)
--- PASS: TestAccRoute53ZoneDataSource_id (112.29s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (114.20s)
--- PASS: TestAccRoute53Zone_multiple (115.26s)
--- PASS: TestAccRoute53Zone_basic (118.37s)
--- PASS: TestAccRoute53Zone_VPC_single (143.43s)
--- PASS: TestAccRoute53ZoneDataSource_tags (146.51s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (152.61s)
--- PASS: TestAccRoute53Zone_VPC_multiple (195.22s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (213.78s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_zone (220.95s)
--- PASS: TestAccRoute53Zone_VPC_updates (267.84s)
--- PASS: TestAccRoute53Zone_forceDestroy (268.90s)
--- PASS: TestAccRoute53ZoneAssociation_basic (270.54s)
--- PASS: TestAccRoute53ZoneAssociation_crossRegion (274.63s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (295.21s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_vpc (242.63s)
--- PASS: TestAccRoute53ZoneAssociation_disappears (231.23s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    336.544s
```
trevorbonas pushed a commit to Bit-Quill/terraform-provider-aws that referenced this pull request Jun 4, 2024
trevorbonas pushed a commit to Bit-Quill/terraform-provider-aws that referenced this pull request Jun 4, 2024
The migration of route53 to AWS SDK V2 introduced a regression which caused the `name_servers` attribute to be set to a list of record sets, rather than a list of name servers. This change returns the value to a list of name servers.

Given a minimal configuration with an internal VPC and associated hosted zone, the `name_servers` output from `v5.51.0` is:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "jb-test.internal.",
  "jb-test.internal.",
])
```

After this patch is applied:

```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

name_server = tolist([
  "ns-0.awsdns-00.com.",
  "ns-1024.awsdns-00.org.",
  "ns-1536.awsdns-00.co.uk.",
  "ns-512.awsdns-00.net.",
])
```

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

=== NAME  TestAccRoute53ZoneAssociation_crossAccountAndRegion
    zone_association_test.go:194: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccountAndRegion (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_serviceDiscovery
=== NAME  TestAccRoute53ZoneAssociation_crossAccount
    zone_association_test.go:132: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRoute53ZoneAssociation_crossAccount (0.42s)
=== CONT  TestAccRoute53ZoneDataSource_vpc
--- PASS: TestAccRoute53Zone_delegationSetID (84.84s)
=== CONT  TestAccRoute53ZoneAssociation_Disappears_vpc
--- PASS: TestAccRoute53Zone_disappears (100.18s)
=== CONT  TestAccRoute53ZoneAssociation_disappears
--- PASS: TestAccRoute53ZoneDataSource_name (104.72s)
--- PASS: TestAccRoute53Zone_tags (106.97s)
--- PASS: TestAccRoute53Zone_comment (109.89s)
--- PASS: TestAccRoute53ZoneDataSource_id (112.29s)
--- PASS: TestAccRoute53ZoneDataSource_serviceDiscovery (114.20s)
--- PASS: TestAccRoute53Zone_multiple (115.26s)
--- PASS: TestAccRoute53Zone_basic (118.37s)
--- PASS: TestAccRoute53Zone_VPC_single (143.43s)
--- PASS: TestAccRoute53ZoneDataSource_tags (146.51s)
--- PASS: TestAccRoute53ZoneDataSource_vpc (152.61s)
--- PASS: TestAccRoute53Zone_VPC_multiple (195.22s)
--- PASS: TestAccRoute53Zone_VPC_single_forceDestroy (213.78s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_zone (220.95s)
--- PASS: TestAccRoute53Zone_VPC_updates (267.84s)
--- PASS: TestAccRoute53Zone_forceDestroy (268.90s)
--- PASS: TestAccRoute53ZoneAssociation_basic (270.54s)
--- PASS: TestAccRoute53ZoneAssociation_crossRegion (274.63s)
--- PASS: TestAccRoute53Zone_ForceDestroy_trailingPeriod (295.21s)
--- PASS: TestAccRoute53ZoneAssociation_Disappears_vpc (242.63s)
--- PASS: TestAccRoute53ZoneAssociation_disappears (231.23s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/route53    336.544s
```
trevorbonas pushed a commit to Bit-Quill/terraform-provider-aws that referenced this pull request Jun 4, 2024
Copy link

github-actions bot commented Jul 1, 2024

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 Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/route53 Issues and PRs that pertain to the route53 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_route53_zone return invalid name_servers when private hosted zone
2 participants