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

Add validation to the global_cluster_identifier property on a global cluster #30996

Merged
merged 17 commits into from
Aug 14, 2023

Conversation

petetanton
Copy link
Contributor

@petetanton petetanton commented Apr 26, 2023

This PR aims to add validation to the global_cluster_identifier to avoid cases where applies can fail because the global cluster id is invalid and it would be much nicer if this could fail at plan time.

Closes #30131.

@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 size/XS Managed by automation to categorize the size of a PR. service/rds Issues and PRs that pertain to the rds service. needs-triage Waiting for first response or review from a maintainer. labels Apr 26, 2023
@petetanton petetanton changed the title [WIP] Add validation to the global_cluster_identifier property on a global cluster Add validation to the global_cluster_identifier property on a global cluster Apr 26, 2023
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 27, 2023
@ewbankkit ewbankkit self-assigned this Aug 11, 2023
@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 Aug 11, 2023
…stAccRDSGlobalCluster_forceDestroy'.

Acceptance test output:

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_basic$$\|^TestAccRDSGlobalCluster_forceDestroy$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_basic$\|^TestAccRDSGlobalCluster_forceDestroy$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_basic
=== PAUSE TestAccRDSGlobalCluster_basic
=== RUN   TestAccRDSGlobalCluster_forceDestroy
=== PAUSE TestAccRDSGlobalCluster_forceDestroy
=== CONT  TestAccRDSGlobalCluster_basic
=== CONT  TestAccRDSGlobalCluster_forceDestroy
--- PASS: TestAccRDSGlobalCluster_forceDestroy (24.80s)
--- PASS: TestAccRDSGlobalCluster_basic (28.05s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	33.229s
@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 12, 2023

% make testacc TESTARGS='-run=TestAccRDSInstanceDataSource_tags' PKG=rds
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 20  -run=TestAccRDSInstanceDataSource_tags -timeout 180m
=== RUN   TestAccRDSInstanceDataSource_tags
=== PAUSE TestAccRDSInstanceDataSource_tags
=== CONT  TestAccRDSInstanceDataSource_tags
--- PASS: TestAccRDSInstanceDataSource_tags (650.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	655.663s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_EngineVersion_updateMinor$$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajor$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_EngineVersion_updateMinor$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajor$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMajor
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMajor
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMajor
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMajor (2379.92s)
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMinor (7382.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	7387.736s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion$$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion (5015.07s)
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion (9662.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	9667.498s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_storageEncrypted$$\|^TestAccRDSGlobalCluster_databaseName$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_storageEncrypted$\|^TestAccRDSGlobalCluster_databaseName$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_databaseName
=== PAUSE TestAccRDSGlobalCluster_databaseName
=== RUN   TestAccRDSGlobalCluster_storageEncrypted
=== PAUSE TestAccRDSGlobalCluster_storageEncrypted
=== CONT  TestAccRDSGlobalCluster_databaseName
=== CONT  TestAccRDSGlobalCluster_storageEncrypted
--- PASS: TestAccRDSGlobalCluster_databaseName (47.12s)
--- PASS: TestAccRDSGlobalCluster_storageEncrypted (48.08s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	52.936s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_deletionProtection$$\|^TestAccRDSGlobalCluster_disappears$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_deletionProtection$\|^TestAccRDSGlobalCluster_disappears$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_disappears
=== PAUSE TestAccRDSGlobalCluster_disappears
=== RUN   TestAccRDSGlobalCluster_deletionProtection
=== PAUSE TestAccRDSGlobalCluster_deletionProtection
=== CONT  TestAccRDSGlobalCluster_disappears
=== CONT  TestAccRDSGlobalCluster_deletionProtection
--- PASS: TestAccRDSGlobalCluster_disappears (21.41s)
--- PASS: TestAccRDSGlobalCluster_deletionProtection (74.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	79.412s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_basic$$\|^TestAccRDSGlobalCluster_forceDestroy$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_basic$\|^TestAccRDSGlobalCluster_forceDestroy$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_basic
=== PAUSE TestAccRDSGlobalCluster_basic
=== RUN   TestAccRDSGlobalCluster_forceDestroy
=== PAUSE TestAccRDSGlobalCluster_forceDestroy
=== CONT  TestAccRDSGlobalCluster_basic
=== CONT  TestAccRDSGlobalCluster_forceDestroy
--- PASS: TestAccRDSGlobalCluster_forceDestroy (24.80s)
--- PASS: TestAccRDSGlobalCluster_basic (28.05s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	33.229s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSCluster_GlobalClusterIdentifier' PKG=rds ACCTEST_PARALLELISM=3 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSCluster_GlobalClusterIdentifier -timeout 720m
=== RUN   TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global
=== RUN   TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add
=== RUN   TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove
=== RUN   TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update
=== RUN   TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned
=== RUN   TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters
=== RUN   TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier
=== RUN   TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding
=== PAUSE TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global (170.91s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned (232.96s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove (163.25s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update (164.43s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters
--- PASS: TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier (2920.57s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add (184.26s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding (3068.39s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters (3209.16s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	3775.490s
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSCluster_port$$\|^TestAccRDSCluster_EngineMode_parallelQuery$$\|^TestAccRDSCluster_SnapshotIdentifierEngineMode_parallelQuery$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSCluster_port$\|^TestAccRDSCluster_EngineMode_parallelQuery$\|^TestAccRDSCluster_SnapshotIdentifierEngineMode_parallelQuery$ -timeout 720m
=== RUN   TestAccRDSCluster_port
=== PAUSE TestAccRDSCluster_port
=== CONT  TestAccRDSCluster_port
--- PASS: TestAccRDSCluster_port (232.19s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	237.443s

…ed' and 'TestAccRDSGlobalCluster_databaseName'.

Acceptance test output:

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_storageEncrypted$$\|^TestAccRDSGlobalCluster_databaseName$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_storageEncrypted$\|^TestAccRDSGlobalCluster_databaseName$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_databaseName
=== PAUSE TestAccRDSGlobalCluster_databaseName
=== RUN   TestAccRDSGlobalCluster_storageEncrypted
=== PAUSE TestAccRDSGlobalCluster_storageEncrypted
=== CONT  TestAccRDSGlobalCluster_databaseName
=== CONT  TestAccRDSGlobalCluster_storageEncrypted
--- PASS: TestAccRDSGlobalCluster_databaseName (47.12s)
--- PASS: TestAccRDSGlobalCluster_storageEncrypted (48.08s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	52.936s
…tion' and 'TestAccRDSGlobalCluster_disappears'.

Acceptance test output:

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_deletionProtection$$\|^TestAccRDSGlobalCluster_disappears$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_deletionProtection$\|^TestAccRDSGlobalCluster_disappears$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_disappears
=== PAUSE TestAccRDSGlobalCluster_disappears
=== RUN   TestAccRDSGlobalCluster_deletionProtection
=== PAUSE TestAccRDSGlobalCluster_deletionProtection
=== CONT  TestAccRDSGlobalCluster_disappears
=== CONT  TestAccRDSGlobalCluster_deletionProtection
--- PASS: TestAccRDSGlobalCluster_disappears (21.41s)
--- PASS: TestAccRDSGlobalCluster_deletionProtection (74.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	79.412s
…updateMinorMultiRegion' and 'TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion'.

Acceptance test output:

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion$$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion (5015.07s)
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion (9662.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	9667.498s
…updateMinor' and 'TestAccRDSGlobalCluster_EngineVersion_updateMajor'.

Acceptance test output:

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=^TestAccRDSGlobalCluster_EngineVersion_updateMinor$$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajor$$' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=^TestAccRDSGlobalCluster_EngineVersion_updateMinor$\|^TestAccRDSGlobalCluster_EngineVersion_updateMajor$ -timeout 720m
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== RUN   TestAccRDSGlobalCluster_EngineVersion_updateMajor
=== PAUSE TestAccRDSGlobalCluster_EngineVersion_updateMajor
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMinor
=== CONT  TestAccRDSGlobalCluster_EngineVersion_updateMajor
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMajor (2379.92s)
--- PASS: TestAccRDSGlobalCluster_EngineVersion_updateMinor (7382.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	7387.736s
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. sweeper Pertains to changes to or issues with the sweeper. and removed size/XS Managed by automation to categorize the size of a PR. labels Aug 13, 2023
Remove `testAccGlobalClusterConfig_engine`.
@ewbankkit
Copy link
Contributor

@petetanton Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 383b4e9 into hashicorp:main Aug 14, 2023
34 checks passed
@github-actions github-actions bot added this to the v5.13.0 milestone Aug 14, 2023
@petetanton petetanton deleted the rds_global_cluster_id_validation branch August 14, 2023 13:07
@github-actions
Copy link

This functionality has been released in v5.13.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 Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/rds Issues and PRs that pertain to the rds service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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]: resource/aws_rds_cluster: Acceptance tests for fail
3 participants