-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Refactor tagging to use keyvaluetags library #10483
Conversation
merge changes
pull changes
merge changes
aws/resource_aws_rds_cluster.go
Outdated
tagList, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ | ||
ResourceName: aws.String(aws.StringValue(dbc.DBClusterArn)), | ||
}) | ||
if err != nil { | ||
return fmt.Errorf("Failed to get RDS Cluster parameter tags for %s: %s", aws.StringValue(dbc.DBClusterIdentifier), err) | ||
} | ||
if err := d.Set("tags", keyvaluetags.RdsKeyValueTags(tagList.TagList).IgnoreAws().Map()); err != nil { | ||
return fmt.Errorf("[WARN] Failed to save tags for RDS Cluster (%s): %s", aws.StringValue(dbc.DBClusterIdentifier), err) |
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.
Can you please switch this to the keyvaluetags
package function RdsListTags
? Thanks!
tags, err := keyvaluetags.RdsListTags(conn, aws.StringValue(dbc.DBClusterArn))
if err != nil {
return fmt.Errorf("error listing tags for RDS Cluster (%s): %s", aws.StringValue(dbc.DBClusterArn), err)
}
if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil {
return fmt.Errorf("error setting tags: %s", err)
}
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.
missed that one, done.
|
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.
Looks good to me, thanks for this @DrFaust92 🚀
Output from acceptance testing (testing failures unrelated):
--- PASS: TestAccAWSRDSClusterInstance_namePrefix (615.04s)
--- PASS: TestAccAWSRDSClusterInstance_CopyTagsToSnapshot (697.46s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraPostgresql (732.32s)
--- PASS: TestAccAWSRDSClusterInstance_az (732.74s)
--- PASS: TestAccAWSRDSClusterInstance_disappears (736.33s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql1 (752.13s)
--- PASS: TestAccAWSRDSClusterInstance_kmsKey (781.41s)
--- PASS: TestAccAWSRDSClusterInstance_generatedName (784.35s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1 (792.55s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2_DefaultKeyToCustomKey (836.28s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2 (843.00s)
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (3.37s)
--- PASS: TestAccAWSRDSCluster_basic (119.62s)
--- PASS: TestAccAWSRDSCluster_AvailabilityZones (120.42s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1_DefaultKeyToCustomKey (856.65s)
--- PASS: TestAccAWSRDSClusterInstance_PubliclyAccessible (858.62s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql2 (863.08s)
--- PASS: TestAccAWSRDSCluster_BacktrackWindow (144.43s)
--- PASS: TestAccAWSRDSCluster_ClusterIdentifierPrefix (129.29s)
--- PASS: TestAccAWSRDSCluster_DbSubnetGroupName (113.02s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_RemovedToEnabled (910.20s)
--- PASS: TestAccAWSRDSCluster_generatedName (129.29s)
--- PASS: TestAccAWSRDSCluster_Tags (109.66s)
--- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (140.03s)
--- PASS: TestAccAWSRDSCluster_encrypted (119.31s)
--- PASS: TestAccAWSRDSCluster_kmsKey (138.51s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToRemoved (1001.55s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToDisabled (1014.31s)
--- PASS: TestAccAWSRDSCluster_updateIamRoles (166.13s)
--- PASS: TestAccAWSRDSCluster_iamAuth (129.62s)
--- PASS: TestAccAWSRDSCluster_backupsUpdate (144.39s)
--- PASS: TestAccAWSRDSCluster_copyTagsToSnapshot (180.30s)
--- PASS: TestAccAWSRDSCluster_DeletionProtection (134.65s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Global (130.18s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Multimaster (123.49s)
--- PASS: TestAccAWSRDSCluster_EngineVersion (131.61s)
--- PASS: TestAccAWSRDSCluster_EngineMode_ParallelQuery (149.45s)
--- PASS: TestAccAWSRDSCluster_EnabledCloudwatchLogsExports (316.41s)
--- SKIP: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Serverless (0.00s)
--- FAIL: TestAccAWSRDSCluster_EngineMode (269.83s)
--- PASS: TestAccAWSRDSClusterEndpoint_basic (1199.79s)
--- PASS: TestAccAWSRDSCluster_Port (245.86s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringInterval (1330.13s)
--- PASS: TestAccAWSRDSCluster_ScalingConfiguration (329.07s)
--- PASS: TestAccAWSRDSClusterInstance_basic (1394.46s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (327.15s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql_DefaultKeyToCustomKey (739.93s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql (827.55s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned (347.17s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection (393.05s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery (407.94s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterPassword (337.06s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different (387.04s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal (407.20s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterUsername (327.23s)
--- FAIL: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow (303.76s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow (326.91s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (347.21s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (328.19s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore (317.03s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (348.14s)
--- PASS: TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance (1094.88s)
--- FAIL: TestAccAWSRDSCluster_s3Restore (1491.68s)
--- PASS: TestAccAWSRDSCluster_EncryptedCrossRegionReplication (1474.46s)
--- FAIL: TestAccAWSRDSCluster_GlobalClusterIdentifier_Remove (2984.93s)
--- FAIL: TestAccAWSRDSCluster_GlobalClusterIdentifier (3146.46s)
--- FAIL: TestAccAWSRDSCluster_GlobalClusterIdentifier_Add (3152.06s)
--- FAIL: TestAccAWSRDSCluster_GlobalClusterIdentifier_Update (3219.22s)
This has been released in version 2.35.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 for triage. Thanks! |
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! |
Community Note
Reference: #7926 , #10688
Release note for CHANGELOG:
Output from acceptance testing: