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

Fix: Custom Domain recreating on update truststore #30081

Merged
merged 15 commits into from
Mar 17, 2023

Conversation

thezeroend
Copy link
Contributor

Description

Removed ForceNew parameter for truststore_uri and made adjustment for parameter change

Relations

Closes #29970

References

Output from Acceptance Testing

$ make testacc TESTS=TestAccAPIGatewayDomainName PKG=apigateway
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 20 -run='TestAccAPIGatewayDomainName'  -timeout 180m
=== RUN   TestAccAPIGatewayDomainNameDataSource_basic
=== PAUSE TestAccAPIGatewayDomainNameDataSource_basic
=== RUN   TestAccAPIGatewayDomainName_certificateARN
=== PAUSE TestAccAPIGatewayDomainName_certificateARN
=== RUN   TestAccAPIGatewayDomainName_certificateName
    domain_name_test.go:63: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. This environment variable must be set to any non-empty value with a publicly trusted certificate body to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_certificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateARN
=== PAUSE TestAccAPIGatewayDomainName_regionalCertificateARN
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateName
    domain_name_test.go:159: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_REGIONAL_CERTIFICATE_NAME_ENABLED is not set. This environment variable must be set to any non-empty value in a region where uploading REGIONAL certificates is allowed to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_regionalCertificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_securityPolicy
=== PAUSE TestAccAPIGatewayDomainName_securityPolicy
=== RUN   TestAccAPIGatewayDomainName_tags
=== PAUSE TestAccAPIGatewayDomainName_tags
=== RUN   TestAccAPIGatewayDomainName_disappears
=== PAUSE TestAccAPIGatewayDomainName_disappears
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayDomainNameDataSource_basic
=== CONT  TestAccAPIGatewayDomainName_tags
=== CONT  TestAccAPIGatewayDomainName_regionalCertificateARN
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== CONT  TestAccAPIGatewayDomainName_certificateARN
=== CONT  TestAccAPIGatewayDomainName_securityPolicy
=== CONT  TestAccAPIGatewayDomainName_disappears
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
--- PASS: TestAccAPIGatewayDomainName_disappears (58.30s)
--- PASS: TestAccAPIGatewayDomainName_tags (128.56s)
--- PASS: TestAccAPIGatewayDomainName_regionalCertificateARN (149.93s)
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership (185.56s)
--- PASS: TestAccAPIGatewayDomainNameDataSource_basic (331.67s)
--- PASS: TestAccAPIGatewayDomainName_securityPolicy (363.86s)
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic (497.26s)
--- PASS: TestAccAPIGatewayDomainName_certificateARN (1093.55s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 1094.202s

$ make testacc TESTS=TestAccAPIGatewayV2DomainName PKG=apigatewayv2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigatewayv2/... -v -count 1 -parallel 20 -run='TestAccAPIGatewayV2DomainName'  -timeout 180m
=== RUN   TestAccAPIGatewayV2DomainName_basic
=== PAUSE TestAccAPIGatewayV2DomainName_basic
=== RUN   TestAccAPIGatewayV2DomainName_disappears
=== PAUSE TestAccAPIGatewayV2DomainName_disappears
=== RUN   TestAccAPIGatewayV2DomainName_tags
=== PAUSE TestAccAPIGatewayV2DomainName_tags
=== RUN   TestAccAPIGatewayV2DomainName_updateCertificate
=== PAUSE TestAccAPIGatewayV2DomainName_updateCertificate
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayV2DomainName_basic
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== CONT  TestAccAPIGatewayV2DomainName_tags
=== CONT  TestAccAPIGatewayV2DomainName_updateCertificate
=== CONT  TestAccAPIGatewayV2DomainName_disappears
--- PASS: TestAccAPIGatewayV2DomainName_disappears (32.53s)
--- PASS: TestAccAPIGatewayV2DomainName_basic (125.56s)
=== NAME  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
    domain_name_test.go:353: Step 1/2 error: Error running apply: exit status 1

        Error: creating API Gateway v2 domain name (tf-acc-w3qbkps4gncz3bsq7r2xb0ccgj0cketsymaoxze.thezeroend.click): BadRequestException: The certificate subject tf-acc-w3qbkps4gncz3bsq7r2xb0ccgj0cketsymaoxze.thezeroend.click conflicts with an existing certificate from a different issuer.

          with aws_apigatewayv2_domain_name.test,
          on terraform_plugin_test.tf line 67, in resource "aws_apigatewayv2_domain_name" "test":
          67: resource "aws_apigatewayv2_domain_name" "test" {

--- PASS: TestAccAPIGatewayV2DomainName_tags (146.44s)
--- FAIL: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership (182.14s)
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion (318.68s)
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic (490.84s)
--- PASS: TestAccAPIGatewayV2DomainName_updateCertificate (1490.53s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2       1491.359s
FAIL

@github-actions
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 service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/M Managed by automation to categorize the size of a PR. labels Mar 17, 2023
@thezeroend
Copy link
Contributor Author

Test "TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership" was broken before the change.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Mar 17, 2023
ewbankkit and others added 9 commits March 17, 2023 08:27
Acceptance test output:

% AWS_DEFAULT_REGION=us-east-1 ACM_CERTIFICATE_ROOT_DOMAIN=example.com make testacc TESTARGS='-run=TestAccAPIGatewayDomainName_' PKG=apigateway ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 2  -run=TestAccAPIGatewayDomainName_ -timeout 180m
=== RUN   TestAccAPIGatewayDomainName_certificateARN
=== PAUSE TestAccAPIGatewayDomainName_certificateARN
=== RUN   TestAccAPIGatewayDomainName_certificateName
    domain_name_test.go:60: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. This environment variable must be set to any non-empty value with a publicly trusted certificate body to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_certificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateARN
=== PAUSE TestAccAPIGatewayDomainName_regionalCertificateARN
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateName
    domain_name_test.go:156: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_REGIONAL_CERTIFICATE_NAME_ENABLED is not set. This environment variable must be set to any non-empty value in a region where uploading REGIONAL certificates is allowed to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_regionalCertificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_securityPolicy
=== PAUSE TestAccAPIGatewayDomainName_securityPolicy
=== RUN   TestAccAPIGatewayDomainName_tags
=== PAUSE TestAccAPIGatewayDomainName_tags
=== RUN   TestAccAPIGatewayDomainName_disappears
=== PAUSE TestAccAPIGatewayDomainName_disappears
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayDomainName_certificateARN
=== CONT  TestAccAPIGatewayDomainName_disappears
--- PASS: TestAccAPIGatewayDomainName_disappears (24.34s)
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership (117.54s)
=== CONT  TestAccAPIGatewayDomainName_securityPolicy
--- PASS: TestAccAPIGatewayDomainName_securityPolicy (31.74s)
=== CONT  TestAccAPIGatewayDomainName_tags
--- PASS: TestAccAPIGatewayDomainName_tags (76.87s)
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
--- PASS: TestAccAPIGatewayDomainName_certificateARN (977.02s)
=== CONT  TestAccAPIGatewayDomainName_regionalCertificateARN
--- PASS: TestAccAPIGatewayDomainName_regionalCertificateARN (30.39s)
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic (1580.87s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigateway	1836.647s
Acceptance test output:

% ACM_CERTIFICATE_ROOT_DOMAIN=example.com make testacc TESTARGS='-run=TestAccAPIGatewayV2DomainName_' PKG=apigatewayv2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigatewayv2/... -v -count 1 -parallel 2  -run=TestAccAPIGatewayV2DomainName_ -timeout 180m
=== RUN   TestAccAPIGatewayV2DomainName_basic
=== PAUSE TestAccAPIGatewayV2DomainName_basic
=== RUN   TestAccAPIGatewayV2DomainName_disappears
=== PAUSE TestAccAPIGatewayV2DomainName_disappears
=== RUN   TestAccAPIGatewayV2DomainName_tags
=== PAUSE TestAccAPIGatewayV2DomainName_tags
=== RUN   TestAccAPIGatewayV2DomainName_updateCertificate
=== PAUSE TestAccAPIGatewayV2DomainName_updateCertificate
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayV2DomainName_basic
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
--- PASS: TestAccAPIGatewayV2DomainName_basic (72.32s)
=== CONT  TestAccAPIGatewayV2DomainName_tags
--- PASS: TestAccAPIGatewayV2DomainName_tags (75.42s)
=== CONT  TestAccAPIGatewayV2DomainName_updateCertificate
--- PASS: TestAccAPIGatewayV2DomainName_updateCertificate (406.98s)
=== CONT  TestAccAPIGatewayV2DomainName_disappears
--- PASS: TestAccAPIGatewayV2DomainName_disappears (19.97s)
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership (114.07s)
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion (134.06s)
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic (1645.61s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2	1652.797s
This reverts commit f3a194c.
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Mar 17, 2023
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 🚀.

% ACM_CERTIFICATE_ROOT_DOMAIN=example.com make testacc TESTARGS='-run=TestAccAPIGatewayV2DomainName_' PKG=apigatewayv2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigatewayv2/... -v -count 1 -parallel 2  -run=TestAccAPIGatewayV2DomainName_ -timeout 180m
=== RUN   TestAccAPIGatewayV2DomainName_basic
=== PAUSE TestAccAPIGatewayV2DomainName_basic
=== RUN   TestAccAPIGatewayV2DomainName_disappears
=== PAUSE TestAccAPIGatewayV2DomainName_disappears
=== RUN   TestAccAPIGatewayV2DomainName_tags
=== PAUSE TestAccAPIGatewayV2DomainName_tags
=== RUN   TestAccAPIGatewayV2DomainName_updateCertificate
=== PAUSE TestAccAPIGatewayV2DomainName_updateCertificate
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
=== RUN   TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayV2DomainName_basic
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic
--- PASS: TestAccAPIGatewayV2DomainName_basic (72.32s)
=== CONT  TestAccAPIGatewayV2DomainName_tags
--- PASS: TestAccAPIGatewayV2DomainName_tags (75.42s)
=== CONT  TestAccAPIGatewayV2DomainName_updateCertificate
--- PASS: TestAccAPIGatewayV2DomainName_updateCertificate (406.98s)
=== CONT  TestAccAPIGatewayV2DomainName_disappears
--- PASS: TestAccAPIGatewayV2DomainName_disappears (19.97s)
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership (114.07s)
=== CONT  TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion (134.06s)
--- PASS: TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic (1645.61s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2	1652.797s
% ACM_CERTIFICATE_ROOT_DOMAIN=ewbankkit.com make testacc TESTARGS='-run=TestAccAPIGatewayV2DomainName_' PKG=apigatewayv2 ACCTEST_PARALLELISM=2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 2  -run=TestAccAPIGatewayDomainName_ -timeout 180m
=== RUN   TestAccAPIGatewayDomainName_certificateARN
=== PAUSE TestAccAPIGatewayDomainName_certificateARN
=== RUN   TestAccAPIGatewayDomainName_certificateName
    domain_name_test.go:60: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. This environment variable must be set to any non-empty value with a publicly trusted certificate body to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_certificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateARN
=== PAUSE TestAccAPIGatewayDomainName_regionalCertificateARN
=== RUN   TestAccAPIGatewayDomainName_regionalCertificateName
    domain_name_test.go:156: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_REGIONAL_CERTIFICATE_NAME_ENABLED is not set. This environment variable must be set to any non-empty value in a region where uploading REGIONAL certificates is allowed to enable the test.
--- SKIP: TestAccAPIGatewayDomainName_regionalCertificateName (0.00s)
=== RUN   TestAccAPIGatewayDomainName_securityPolicy
=== PAUSE TestAccAPIGatewayDomainName_securityPolicy
=== RUN   TestAccAPIGatewayDomainName_tags
=== PAUSE TestAccAPIGatewayDomainName_tags
=== RUN   TestAccAPIGatewayDomainName_disappears
=== PAUSE TestAccAPIGatewayDomainName_disappears
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
=== RUN   TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
=== CONT  TestAccAPIGatewayDomainName_certificateARN
=== CONT  TestAccAPIGatewayDomainName_disappears
--- PASS: TestAccAPIGatewayDomainName_disappears (24.34s)
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership (117.54s)
=== CONT  TestAccAPIGatewayDomainName_securityPolicy
--- PASS: TestAccAPIGatewayDomainName_securityPolicy (31.74s)
=== CONT  TestAccAPIGatewayDomainName_tags
--- PASS: TestAccAPIGatewayDomainName_tags (76.87s)
=== CONT  TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic
--- PASS: TestAccAPIGatewayDomainName_certificateARN (977.02s)
=== CONT  TestAccAPIGatewayDomainName_regionalCertificateARN
--- PASS: TestAccAPIGatewayDomainName_regionalCertificateARN (30.39s)
--- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic (1580.87s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigateway	1836.647s

@ewbankkit
Copy link
Contributor

@thezeroend Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit b51df9a into hashicorp:main Mar 17, 2023
@github-actions github-actions bot added this to the v4.60.0 milestone Mar 17, 2023
@github-actions
Copy link

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

@github-actions
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 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. size/XL 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.

[Bug]: Api Gateway Domain Name being recreated when truststore is changed
3 participants