-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_rds_cluster: Prevent InvalidParameterCombination
error with engine_version
and snapshot_identifier
on creation
#6391
Conversation
… with `engine_version` and `snapshot_identifier` on creation This is a similar refactoring to the `aws_db_instance` resource that has occurred recently over a few iterations. The refactoring prevents a class of potential bugs related to unexpected update errors or an extraneous update after restoring from snapshot or S3. Instead we should be left with "requires two applies" type issues, which are more workable. Changes: * resource/aws_rds_cluster: Refactor Create function to call ModifyDBCluster directly instead of Update function Output from acceptance testing: ``` --- PASS: TestAccAWSRDSCluster_BacktrackWindow (177.25s) --- PASS: TestAccAWSRDSCluster_backupsUpdate (194.40s) --- PASS: TestAccAWSRDSCluster_basic (123.91s) --- PASS: TestAccAWSRDSCluster_DeletionProtection (195.88s) --- PASS: TestAccAWSRDSCluster_encrypted (124.72s) --- PASS: TestAccAWSRDSCluster_EncryptedCrossRegionReplication (1578.13s) --- PASS: TestAccAWSRDSCluster_EngineMode (378.92s) --- PASS: TestAccAWSRDSCluster_EngineMode_ParallelQuery (128.98s) --- PASS: TestAccAWSRDSCluster_EngineVersion (137.07s) --- PASS: TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance (1117.06s) --- PASS: TestAccAWSRDSCluster_generatedName (145.47s) --- PASS: TestAccAWSRDSCluster_iamAuth (156.83s) --- PASS: TestAccAWSRDSCluster_importBasic (128.64s) --- PASS: TestAccAWSRDSCluster_kmsKey (143.46s) --- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (2.34s) --- PASS: TestAccAWSRDSCluster_namePrefix (123.69s) --- PASS: TestAccAWSRDSCluster_Port (297.06s) --- PASS: TestAccAWSRDSCluster_s3Restore (1391.94s) --- PASS: TestAccAWSRDSCluster_ScalingConfiguration (281.57s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (364.76s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection (490.59s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore (426.54s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery (366.46s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned (355.81s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different (386.44s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal (407.85s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow (355.70s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow (386.74s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (364.61s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (362.35s) --- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (463.75s) --- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (186.68s) --- PASS: TestAccAWSRDSCluster_updateCloudwatchLogsExports (163.99s) --- PASS: TestAccAWSRDSCluster_updateIamRoles (143.56s) --- PASS: TestAccAWSRDSCluster_updateTags (163.35s) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
aws/resource_aws_rds_cluster.go
Outdated
clusterUpdate = true | ||
if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { | ||
opts.VpcSecurityGroupIds = expandStringList(attr.List()) | ||
// requiresModifyDbCluster = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intentionally commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! For some reason the old code had it (so it was being set both during create and calling an update) and I was experimenting 🔬 -- experiment was a success! I'll remove it. 👍
This has been released in version 1.43.1 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fixes #6157
This is a similar refactoring to the
aws_db_instance
resource that has occurred recently over a few iterations. The refactoring prevents a class of potential bugs related to unexpected update errors or an extraneous update after restoring from snapshot or S3. Instead we should be left with "requires two applies" type issues, which are more workable.Changes:
Output from acceptance testing: