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

resource/aws_rds_cluster: Refactor tagging to use keyvaluetags library #10483

Merged
merged 5 commits into from
Nov 4, 2019

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Oct 12, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #7926 , #10688

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSRDSCluster_Tags'

=== RUN   TestAccAWSRDSCluster_Tags
=== PAUSE TestAccAWSRDSCluster_Tags
=== CONT  TestAccAWSRDSCluster_Tags
--- PASS: TestAccAWSRDSCluster_Tags (207.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	213.038s

...
$ make testacc TESTARGS='-run=TestAccAWSRDSCluster_basic'

=== RUN   TestAccAWSRDSCluster_basic
=== PAUSE TestAccAWSRDSCluster_basic
=== CONT  TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (155.80s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	163.512s


...

@DrFaust92 DrFaust92 requested a review from a team October 12, 2019 13:55
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/rds Issues and PRs that pertain to the rds service. labels Oct 12, 2019
@DrFaust92 DrFaust92 changed the title esource/aws_rds_cluster: Refactor tagging to use keyvaluetags library resource/aws_rds_cluster: Refactor tagging to use keyvaluetags library Oct 12, 2019
Comment on lines 1036 to 1043
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)
Copy link
Contributor

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)
}

Copy link
Collaborator Author

@DrFaust92 DrFaust92 Nov 2, 2019

Choose a reason for hiding this comment

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

missed that one, done.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. technical-debt Addresses areas of the codebase that need refactoring or redesign. waiting-response Maintainers are waiting on response from community or contributor. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Nov 2, 2019
@bflad bflad self-assigned this Nov 2, 2019
@DrFaust92
Copy link
Collaborator Author

--- PASS: TestAccAWSRDSCluster_basic (131.98s)
--- PASS: TestAccAWSRDSCluster_Tags (203.84s)

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 2, 2019
@DrFaust92 DrFaust92 requested a review from bflad November 2, 2019 11:51
@bflad bflad added this to the v2.35.0 milestone Nov 4, 2019
Copy link
Contributor

@bflad bflad left a 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)

@bflad bflad merged commit af329f3 into hashicorp:master Nov 4, 2019
@ghost
Copy link

ghost commented Nov 7, 2019

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!

@DrFaust92 DrFaust92 deleted the rds-cluster-tags branch November 9, 2019 12:41
@ghost
Copy link

ghost commented Mar 29, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants