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_redshift_cluster: Send correct values when resizing #3127

Merged
merged 3 commits into from
May 7, 2018

Conversation

kenXengineering
Copy link
Contributor

When resizing a Redshift cluster, the AWS API is expecting the Cluster
Type, Node Type, and Number of Nodes regardless of which value changed.
If not passed it will error out with
[WARN] Error modifying Redshift Cluster (navistone-public-cluster): InvalidParameterCombination: Number of nodes for cluster type multi-node must be greater than or equal to 2

Now we send all values if any one of them change. Closes #484

Signed-off-by: Ken Herner kherner@navistone.com

@bflad bflad added bug Addresses a defect in current functionality. service/redshift Issues and PRs that pertain to the redshift service. labels Jan 25, 2018
@@ -342,6 +342,47 @@ func TestAccAWSRedshiftCluster_updateNodeCount(t *testing.T) {
testAccCheckAWSRedshiftClusterExists("aws_redshift_cluster.default", &v),
resource.TestCheckResourceAttr(
"aws_redshift_cluster.default", "number_of_nodes", "2"),
resource.TestCheckResourceAttr(
"aws_redshift_cluster.default", "cluster-type", "multi-node"),
Copy link
Contributor

Choose a reason for hiding this comment

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

For all uses in the testing here, the cluster-type attribute should be cluster_type and node-type should be node_type to match the resource schema, otherwise testing fails. e.g.:

=== RUN   TestAccAWSRedshiftCluster_updateNodeCount
--- FAIL: TestAccAWSRedshiftCluster_updateNodeCount (2421.66s)
    testing.go:513: Step 1 error: Check failed: Check 3/4 error: aws_redshift_cluster.default: Attribute 'cluster-type' not found
=== RUN   TestAccAWSRedshiftCluster_updateNodeType
--- FAIL: TestAccAWSRedshiftCluster_updateNodeType (923.17s)
    testing.go:513: Step 0 error: Check failed: Check 2/2 error: aws_redshift_cluster.default: Attribute 'node-type' not found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, I was having issues getting the test to run locally, so I missed that, thanks!

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jan 25, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Jan 29, 2018
@kenXengineering
Copy link
Contributor Author

@bflad Fixed the test cases, thanks for pointing that out.

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 29, 2018
@bflad
Copy link
Contributor

bflad commented Jan 30, 2018

Hmm, I'm getting this strange error when running the acceptance testing now. I will try to look into it later today if I have time.

=== RUN   TestAccAWSRedshiftCluster_updateNodeType
--- FAIL: TestAccAWSRedshiftCluster_updateNodeType (773.13s)
    testing.go:513: Step 1 error: Error applying: 1 error(s) occurred:
        
        * aws_redshift_cluster.default: 1 error(s) occurred:
        
        * aws_redshift_cluster.default: [WARN] Error modifying Redshift Cluster (tf-redshift-cluster-2884899450099823142): InvalidParameterCombination: Single-node with dw2.8xlarge is not supported
            status code: 400, request id: c4b7f272-0542-11e8-85c9-afeaf0a03f38

@poflynn
Copy link

poflynn commented Apr 19, 2018

My team is hitting this now, FYI, thanks for the effort.

@danielpops
Copy link

+1 just encountered this. Anything pending to merge this fix, @bflad?

When resizing a Redshift cluster, the AWS API is expecting the Cluster
Type, Node Type, and Number of Nodes regardless of which value changed.
If not passed it will error out with
`[WARN] Error modifying Redshift Cluster (navistone-public-cluster):
InvalidParameterCombination: Number of nodes for cluster type multi-node
must be greater than or equal to 2`

Now we send all values if any one of them change.

Signed-off-by: Ken Herner <kherner@navistone.com>
Signed-off-by: Ken Herner <kherner@navistone.com>
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label May 4, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label May 4, 2018
Change the node type from dc2.8xlarge to dc2.large to pass E2E testing.

Signed-off-by: Ken Herner <kherner@navistone.com>
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label May 4, 2018
@kenXengineering
Copy link
Contributor Author

@bflad I should have fixed the acceptance test issue with the node type now, could you retest acceptance? Thanks!

@bflad bflad added this to the v1.18.0 milestone May 7, 2018
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 great -- thanks so much for this @chosenken! 🚀

14 tests passed (all tests)
=== RUN   TestAccAWSRedshiftCluster_tags
--- PASS: TestAccAWSRedshiftCluster_tags (789.99s)
=== RUN   TestAccAWSRedshiftCluster_basic
--- PASS: TestAccAWSRedshiftCluster_basic (843.02s)
=== RUN   TestAccAWSRedshiftCluster_loggingEnabledDeprecated
--- PASS: TestAccAWSRedshiftCluster_loggingEnabledDeprecated (902.67s)
=== RUN   TestAccAWSRedshiftCluster_importBasic
--- PASS: TestAccAWSRedshiftCluster_importBasic (924.90s)
=== RUN   TestAccAWSRedshiftCluster_kmsKey
--- PASS: TestAccAWSRedshiftCluster_kmsKey (951.25s)
=== RUN   TestAccAWSRedshiftCluster_loggingEnabled
--- PASS: TestAccAWSRedshiftCluster_loggingEnabled (994.20s)
=== RUN   TestAccAWSRedshiftCluster_snapshotCopy
--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (1029.16s)
=== RUN   TestAccAWSRedshiftCluster_iamRoles
--- PASS: TestAccAWSRedshiftCluster_iamRoles (1056.28s)
=== RUN   TestAccAWSRedshiftCluster_publiclyAccessible
--- PASS: TestAccAWSRedshiftCluster_publiclyAccessible (1067.33s)
=== RUN   TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
--- PASS: TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled (1086.62s)
=== RUN   TestAccAWSRedshiftCluster_withFinalSnapshot
--- PASS: TestAccAWSRedshiftCluster_withFinalSnapshot (1189.87s)
=== RUN   TestAccAWSRedshiftCluster_forceNewUsername
--- PASS: TestAccAWSRedshiftCluster_forceNewUsername (2073.58s)
=== RUN   TestAccAWSRedshiftCluster_updateNodeType
--- PASS: TestAccAWSRedshiftCluster_updateNodeType (2789.65s)
=== RUN   TestAccAWSRedshiftCluster_updateNodeCount
--- PASS: TestAccAWSRedshiftCluster_updateNodeCount (3435.63s)

@bflad
Copy link
Contributor

bflad commented May 10, 2018

This has been released in version 1.18.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 6, 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 6, 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. service/redshift Issues and PRs that pertain to the redshift service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aws_redshift_cluster can't be resized without changing number_of_nodes
4 participants