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

aws_rds_cluster: Prevent error setting engine_mode and scaling_configuration in datasource #5660

Merged
merged 2 commits into from
Aug 29, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Aug 23, 2018

Fixes #5659

We have seen this type of regression before (#4922) due to sharing the same read functionality between the resource and data source, but not updating the data source schema. This completely separates the logic between two so they can be updated independently.

Also prevents other potential panics with:

  • Empty DescribeDBClusters response elements
  • nil dereferences (uses SDK helper functions instead)

Changes proposed in this pull request:

  • Prevent error setting scaling_configuration: Invalid address to set: []string{"scaling_configuration"} in aws_rds_cluster data source
  • Prevent potential panics with empty DescribeDBClusters response elements
  • Prevent potential nil dereference panics
  • Minor refactoring to

Output from acceptance testing:

26 tests passed (all tests)
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (3.10s)
--- PASS: TestAccAWSRDSCluster_iamAuth (96.81s)
--- PASS: TestAccAWSRDSCluster_basic (96.96s)
--- PASS: TestAccAWSRDSCluster_importBasic (97.21s)
--- PASS: TestAccAWSRDSCluster_EngineVersion (97.74s)
--- PASS: TestAccDataSourceAWSRDSCluster_basic (102.63s)
--- PASS: TestAccAWSRDSCluster_updateTags (109.65s)
--- PASS: TestAccAWSRDSCluster_BacktrackWindow (109.89s)
--- PASS: TestAccAWSRDSCluster_encrypted (127.03s)
--- PASS: TestAccAWSRDSCluster_backupsUpdate (129.46s)
--- PASS: TestAccAWSRDSCluster_updateCloudwatchLogsExports (129.81s)
--- PASS: TestAccAWSRDSCluster_namePrefix (130.64s)
--- PASS: TestAccAWSRDSCluster_generatedName (132.30s)
--- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (137.71s)
--- PASS: TestAccAWSRDSCluster_updateIamRoles (139.20s)
--- PASS: TestAccAWSRDSCluster_kmsKey (146.33s)
--- PASS: TestAccAWSRDSCluster_Port (201.69s)
--- PASS: TestAccAWSRDSCluster_ScalingConfiguration (242.98s)
--- PASS: TestAccAWSRDSCluster_EngineMode (336.73s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode (292.69s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (292.91s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (294.77s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (294.22s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (372.75s)
--- PASS: TestAccAWSRDSCluster_s3Restore (1474.22s)
--- PASS: TestAccAWSRDSCluster_EncryptedCrossRegionReplication (1516.92s)

@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service. labels Aug 23, 2018
@bflad bflad requested a review from a team August 23, 2018 14:05
…uration in datasource

Also prevents additional panics with:
* Empty DescribeDBClusters response elements
* Nil dereferences (uses SDK helper functions instead)
@bflad bflad force-pushed the td-aws_rds_cluster-duplicate-read branch from 7029635 to 9622418 Compare August 23, 2018 14:23
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

one really minor thing but this otherwise LGTM 👍

aws/data_source_aws_rds_cluster.go Show resolved Hide resolved
@bflad bflad added this to the v1.34.0 milestone Aug 29, 2018
@bflad bflad merged commit c1c5a3d into master Aug 29, 2018
@bflad bflad deleted the td-aws_rds_cluster-duplicate-read branch August 29, 2018 21:11
bflad added a commit that referenced this pull request Aug 29, 2018
@bflad
Copy link
Contributor Author

bflad commented Aug 30, 2018

This has been released in version 1.34.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 3, 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 Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error setting scaling_configuration: Invalid address to set: []string{"scaling_configuration"}
2 participants