Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_rds_cluster: Consolidate CreateDBCluster logic and preve…
…nt creation issue when global_cluster_identifier and replication_source_identifier are both configured (#14490) Reference: #13715 After adding new acceptance testing with previous resource logic: ``` TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier: testing.go:684: Step 0 error: errors during apply: Error: error creating RDS cluster: InvalidDBClusterStateFault: Source cluster arn:aws:rds:us-west-2:--OMITTED--:cluster:tf-acc-test-728428284997379009-primary doesn't have binlogs enabled. status code: 400, request id: 36e4f744-9080-4a6c-adca-fb2fc660d66e ``` After consolidating `CreateDBCluster` logic (allowing both `global_cluster_identifier` and `replication_source_identifier` to be set in the same call): ``` TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier: testing.go:684: Step 0 error: errors during apply: Error: error creating RDS cluster: InvalidParameterCombination: Value for replicationSourceIdentifier should not be specified for db cluster that is a member of global cluster status code: 400, request id: f8558f28-14d1-49b3-9d94-1a607b1b689d ``` Opt to conditionalize the creation handling for this situation rather than return an error for the conflicting arguments since the existing configuration may be prevalent and the end result is the same. Document `ignore_changes`. Output from acceptance testing (omitting failures from #14384): ``` --- PASS: TestAccAWSRDSCluster_AvailabilityZones (138.84s) --- PASS: TestAccAWSRDSCluster_BacktrackWindow (166.46s) --- PASS: TestAccAWSRDSCluster_backupsUpdate (161.00s) --- PASS: TestAccAWSRDSCluster_basic (143.12s) --- PASS: TestAccAWSRDSCluster_ClusterIdentifierPrefix (137.99s) --- PASS: TestAccAWSRDSCluster_copyTagsToSnapshot (205.95s) --- PASS: TestAccAWSRDSCluster_DbSubnetGroupName (159.06s) --- PASS: TestAccAWSRDSCluster_DeletionProtection (160.99s) --- PASS: TestAccAWSRDSCluster_EnabledCloudwatchLogsExports (341.44s) --- PASS: TestAccAWSRDSCluster_EnableHttpEndpoint (356.65s) --- PASS: TestAccAWSRDSCluster_encrypted (121.15s) --- PASS: TestAccAWSRDSCluster_EngineMode (432.72s) --- PASS: TestAccAWSRDSCluster_EngineMode_Global (139.87s) --- PASS: TestAccAWSRDSCluster_EngineMode_Multimaster (139.86s) --- PASS: TestAccAWSRDSCluster_EngineMode_ParallelQuery (137.74s) --- PASS: TestAccAWSRDSCluster_EngineVersion (425.30s) --- PASS: TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance (1107.25s) --- PASS: TestAccAWSRDSCluster_generatedName (126.84s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global (189.88s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Add (163.70s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Remove (162.57s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Update (172.66s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Provisioned (157.23s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_PrimarySecondaryClusters (1768.71s) --- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier (1747.31s) --- PASS: TestAccAWSRDSCluster_iamAuth (127.32s) --- PASS: TestAccAWSRDSCluster_kmsKey (161.41s) --- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (4.87s) --- PASS: TestAccAWSRDSCluster_Port (253.12s) --- PASS: TestAccAWSRDSCluster_ScalingConfiguration (386.00s) --- PASS: TestAccAWSRDSCluster_ScalingConfiguration_DefaultMinCapacity (379.58s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (371.73s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection (409.17s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore (358.98s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery (439.76s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned (333.04s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different (359.99s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal (337.24s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterPassword (347.53s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterUsername (381.60s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow (379.98s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow (363.89s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (381.05s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (362.04s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (369.15s) --- PASS: TestAccAWSRDSCluster_Tags (136.51s) --- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (207.97s) --- PASS: TestAccAWSRDSCluster_updateIamRoles (180.35s) ```
- Loading branch information