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_rds_cluster: Conflict snapshot_identifier and global_cluster_identifier #30158

Merged
merged 4 commits into from
Mar 22, 2023

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Mar 21, 2023

Description

Triggers a conflict when both snapshot_identifier and global_cluster_identifier are provided in the same configuration. It is not currently possible to restore from snapshot AND join an existing global cluster in a single operation. This plan time check prevents configurations which will succeed with unexpected results (see #29187).

Relations

Closes #29187

References

Output from Acceptance Testing

NOTE: Failing tests do not appear related to this change.

$ make testacc PKG=rds TESTS=TestAccRDSCluster_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccRDSCluster_'  -timeout 180m
--- PASS: TestAccRDSCluster_basic (144.20s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_encryptedRestore
--- PASS: TestAccRDSCluster_EngineMode_global (151.79s)
=== CONT  TestAccRDSCluster_serverlessV2ScalingConfiguration
--- PASS: TestAccRDSCluster_encrypted (151.80s)
=== CONT  TestAccRDSCluster_scaling
--- PASS: TestAccRDSCluster_iamAuth (152.21s)
=== CONT  TestAccRDSCluster_SnapshotIdentifierVPCSecurityGroupIDs_tags
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned (174.67s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_vpcSecurityGroupIDs
--- PASS: TestAccRDSCluster_kmsKey (187.35s)
=== CONT  TestAccRDSCluster_port
--- PASS: TestAccRDSCluster_EngineMode_multiMaster (189.50s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_tags
--- PASS: TestAccRDSCluster_backupsUpdate (189.80s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding
--- PASS: TestAccRDSCluster_deletionProtection (191.87s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_preferredMaintenanceWindow
=== NAME  TestAccRDSCluster_port
    cluster_test.go:1471: Step 1/2 error: Error running apply: exit status 1

        Error: creating RDS Cluster (tf-acc-test-8674226860890088684): InvalidParameterCombination: The Parameter Group default.aurora-postgresql13 with DBParameterGroupFamily aurora-postgresql13 cannot be u
sed for this instance. Please use a Parameter Group with DBParameterGroupFamily aurora-postgresql14
                status code: 400, request id: 0ed4fa2d-c656-459e-84d5-0aacb94ef618

          with aws_rds_cluster.test,
          on terraform_plugin_test.tf line 2, in resource "aws_rds_cluster" "test":
           2: resource "aws_rds_cluster" "test" {

--- FAIL: TestAccRDSCluster_port (5.46s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_preferredBackupWindow
=== NAME  TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding
    cluster_test.go:1443: Step 1/1 error: Error running apply: exit status 1

        Error: creating RDS Global Cluster: InvalidParameterValue: The requested engine version was not found or does not support global functionality
                status code: 400, request id: 50b81a05-caa4-4f1a-bda5-0f6a4ba67447

          with aws_rds_global_cluster.test,
          on terraform_plugin_test.tf line 18, in resource "aws_rds_global_cluster" "test":
          18: resource "aws_rds_global_cluster" "test" {

--- FAIL: TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding (9.54s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_masterUsername
--- PASS: TestAccRDSCluster_updateIAMRoles (223.18s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier
--- PASS: TestAccRDSCluster_EnabledCloudWatchLogsExports_mySQL (231.50s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_masterPassword
--- PASS: TestAccRDSCluster_networkType (276.51s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters
--- PASS: TestAccRDSCluster_Scaling_defaultMinCapacity (284.81s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_kmsKeyID
--- PASS: TestAccRDSCluster_copyTagsToSnapshot (290.75s)
=== CONT  TestAccRDSCluster_missingUserNameCausesError
--- PASS: TestAccRDSCluster_missingUserNameCausesError (5.00s)
=== CONT  TestAccRDSCluster_SnapshotIdentifierEngineVersion_equal
--- PASS: TestAccRDSCluster_serverlessV2ScalingConfiguration (199.13s)
=== CONT  TestAccRDSCluster_SnapshotIdentifierEngineVersion_different
--- PASS: TestAccRDSCluster_enableHTTPEndpoint (353.31s)
=== CONT  TestAccRDSCluster_availabilityZones
--- PASS: TestAccRDSCluster_PointInTimeRestore_enabledCloudWatchLogsExports (446.19s)
=== CONT  TestAccRDSCluster_SnapshotIdentifierEngineMode_provisioned
--- PASS: TestAccRDSCluster_engineMode (446.51s)
=== CONT  TestAccRDSCluster_pointInTimeRestore
--- PASS: TestAccRDSCluster_scaling (306.70s)
=== CONT  TestAccRDSCluster_SnapshotIdentifierEngineMode_parallelQuery
    cluster_test.go:1698: Step 1/1 error: Error running apply: exit status 1

        Error: creating RDS Cluster (tf-acc-test-810470511273405909-source): InvalidParameterCombination: Cannot find version null for aurora
                status code: 400, request id: 5a337cd3-958e-40b7-b2ec-246ec2786b13

          with aws_rds_cluster.source,
          on terraform_plugin_test.tf line 2, in resource "aws_rds_cluster" "source":
           2: resource "aws_rds_cluster" "source" {

--- FAIL: TestAccRDSCluster_SnapshotIdentifierEngineMode_parallelQuery (4.52s)
=== CONT  TestAccRDSCluster_dbSubnetGroupName
--- PASS: TestAccRDSCluster_snapshotIdentifier (474.00s)
=== CONT  TestAccRDSCluster_SnapshotIdentifier_deletionProtection
--- PASS: TestAccRDSCluster_availabilityZones (145.86s)
=== CONT  TestAccRDSCluster_backtrackWindow
--- PASS: TestAccRDSCluster_SnapshotIdentifier_encryptedRestore (426.04s)
=== CONT  TestAccRDSCluster_dbClusterInstanceClass
--- PASS: TestAccRDSCluster_SnapshotIdentifierVPCSecurityGroupIDs_tags (460.79s)
=== CONT  TestAccRDSCluster_takeFinalSnapshot
--- PASS: TestAccRDSCluster_dbSubnetGroupName (153.30s)
=== CONT  TestAccRDSCluster_iops
--- PASS: TestAccRDSCluster_SnapshotIdentifier_preferredMaintenanceWindow (424.97s)
=== CONT  TestAccRDSCluster_allocatedStorage
--- PASS: TestAccRDSCluster_SnapshotIdentifier_masterUsername (425.31s)
=== CONT  TestAccRDSCluster_allowMajorVersionUpgrade
--- PASS: TestAccRDSCluster_SnapshotIdentifier_vpcSecurityGroupIDs (470.06s)
=== CONT  TestAccRDSCluster_onlyMajorVersion
--- PASS: TestAccRDSCluster_SnapshotIdentifier_tags (465.34s)
=== CONT  TestAccRDSCluster_storageType
--- PASS: TestAccRDSCluster_SnapshotIdentifier_preferredBackupWindow (465.65s)
=== CONT  TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParameters
--- PASS: TestAccRDSCluster_SnapshotIdentifier_masterPassword (435.69s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global
--- PASS: TestAccRDSCluster_backtrackWindow (183.75s)
=== CONT  TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParametersApplyImm
--- PASS: TestAccRDSCluster_SnapshotIdentifier_kmsKeyID (466.41s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove
--- PASS: TestAccRDSCluster_SnapshotIdentifierEngineVersion_equal (478.94s)
=== CONT  TestAccRDSCluster_identifierGenerated
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global (169.53s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add
--- PASS: TestAccRDSCluster_SnapshotIdentifierEngineVersion_different (489.36s)
=== CONT  TestAccRDSCluster_identifierPrefix
--- PASS: TestAccRDSCluster_SnapshotIdentifierEngineMode_provisioned (415.55s)
=== CONT  TestAccRDSCluster_engineVersion
--- PASS: TestAccRDSCluster_pointInTimeRestore (418.59s)
=== CONT  TestAccRDSCluster_EngineMode_parallelQuery
--- PASS: TestAccRDSCluster_takeFinalSnapshot (256.16s)
=== CONT  TestAccRDSCluster_engineVersionWithPrimaryInstance
=== NAME  TestAccRDSCluster_EngineMode_parallelQuery
    cluster_test.go:1125: Step 1/1 error: Error running apply: exit status 1

        Error: creating RDS Cluster (tf-acc-test-1459281107440858057): InvalidParameterCombination: Cannot find version null for aurora
                status code: 400, request id: 10dc314c-ea60-4fc2-ab41-fd9e468715b5

          with aws_rds_cluster.test,
          on terraform_plugin_test.tf line 2, in resource "aws_rds_cluster" "test":
           2: resource "aws_rds_cluster" "test" {

--- FAIL: TestAccRDSCluster_EngineMode_parallelQuery (4.51s)
=== CONT  TestAccRDSCluster_tags
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove (168.02s)
=== CONT  TestAccRDSCluster_disappears
--- PASS: TestAccRDSCluster_identifierGenerated (184.77s)
=== CONT  TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update
--- PASS: TestAccRDSCluster_identifierPrefix (133.64s)
--- PASS: TestAccRDSCluster_SnapshotIdentifier_deletionProtection (527.39s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add (173.25s)
--- PASS: TestAccRDSCluster_tags (163.54s)
--- PASS: TestAccRDSCluster_disappears (152.58s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update (164.11s)
=== NAME  TestAccRDSCluster_allowMajorVersionUpgrade
    cluster_test.go:213: Step 3/3 error: Check failed: Check 4/4 error: aws_rds_cluster.test: Attribute 'engine_version' expected "13.5", got "12.9"
--- PASS: TestAccRDSCluster_engineVersion (473.52s)
--- PASS: TestAccRDSCluster_onlyMajorVersion (963.53s)
--- FAIL: TestAccRDSCluster_allowMajorVersionUpgrade (1248.75s)
--- PASS: TestAccRDSCluster_ReplicationSourceIdentifier_kmsKeyID (2158.29s)
--- PASS: TestAccRDSCluster_dbClusterInstanceClass (1734.17s)
--- PASS: TestAccRDSCluster_engineVersionWithPrimaryInstance (1519.82s)
--- PASS: TestAccRDSCluster_EnabledCloudWatchLogsExports_postgresql (2483.04s)
--- PASS: TestAccRDSCluster_iops (1883.29s)
--- PASS: TestAccRDSCluster_allocatedStorage (1893.50s)
--- PASS: TestAccRDSCluster_storageType (1965.67s)
--- PASS: TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParameters (2144.30s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier (2595.85s)
--- PASS: TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParametersApplyImm (2316.59s)
--- PASS: TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters (2827.92s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/rds        3107.866s
FAIL
make: *** [testacc] Error 1

@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. documentation Introduces or discusses updates to documentation. service/rds Issues and PRs that pertain to the rds service. labels Mar 21, 2023
@jar-b jar-b force-pushed the td-aws_rds_cluster-snapshot-with-global-id-warning branch from 0846cf0 to 4edfba2 Compare March 21, 2023 14:43
@jar-b jar-b marked this pull request as ready for review March 21, 2023 16:23
@gdavison gdavison self-assigned this Mar 21, 2023
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

The code change looks good. I got really stuck on the documentation for a couple reasons. First, the linked example was for a different case. Secondly, because the creation order of the RDS global cluster and region cluster is opposite from most other global clusters, such as ElastiCache, I was confused by the example.

website/docs/r/rds_cluster.html.markdown Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Mar 22, 2023
@jar-b jar-b force-pushed the td-aws_rds_cluster-snapshot-with-global-id-warning branch from 3cd0424 to 736d002 Compare March 22, 2023 14:15
@jar-b jar-b merged commit f4b824a into main Mar 22, 2023
@jar-b jar-b deleted the td-aws_rds_cluster-snapshot-with-global-id-warning branch March 22, 2023 19:50
@github-actions github-actions bot added this to the v4.60.0 milestone Mar 22, 2023
github-actions bot pushed a commit that referenced this pull request Mar 22, 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 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/rds Issues and PRs that pertain to the rds service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot create Global Aurora (MySQL) cluster based upon snapshot
2 participants