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

Redshift cluster restore from snapshot: Correctly set number_of_nodes #13203

Merged

Conversation

imdhruva
Copy link
Contributor

@imdhruva imdhruva commented May 7, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13176.
Closes #11367.
Closes #23638.

Release note for CHANGELOG:

fixes redshift cluster restore from d* instances to ra3* instances

Output from acceptance testing:

TODO

@imdhruva imdhruva requested a review from a team May 7, 2020 11:44
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/redshift Issues and PRs that pertain to the redshift service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 7, 2020
@imdhruva

This comment was marked as outdated.

Base automatically changed from master to main January 23, 2021 00:57
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:57
@breathingdust breathingdust added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 21, 2021
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

…r cluster state changes (hashicorp#23638).

Acceptance test output:

% make testacc TESTS=TestAccRedshiftCluster_ PKG=redshift ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshift/... -v -count 1 -parallel 3 -run='TestAccRedshiftCluster_'  -timeout 180m
=== RUN   TestAccRedshiftCluster_basic
=== PAUSE TestAccRedshiftCluster_basic
=== RUN   TestAccRedshiftCluster_disappears
=== PAUSE TestAccRedshiftCluster_disappears
=== RUN   TestAccRedshiftCluster_withFinalSnapshot
=== PAUSE TestAccRedshiftCluster_withFinalSnapshot
=== RUN   TestAccRedshiftCluster_kmsKey
=== PAUSE TestAccRedshiftCluster_kmsKey
=== RUN   TestAccRedshiftCluster_enhancedVPCRoutingEnabled
=== PAUSE TestAccRedshiftCluster_enhancedVPCRoutingEnabled
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== RUN   TestAccRedshiftCluster_iamRoles
=== PAUSE TestAccRedshiftCluster_iamRoles
=== RUN   TestAccRedshiftCluster_publiclyAccessible
=== PAUSE TestAccRedshiftCluster_publiclyAccessible
=== RUN   TestAccRedshiftCluster_updateNodeCount
=== PAUSE TestAccRedshiftCluster_updateNodeCount
=== RUN   TestAccRedshiftCluster_updateNodeType
=== PAUSE TestAccRedshiftCluster_updateNodeType
=== RUN   TestAccRedshiftCluster_tags
=== PAUSE TestAccRedshiftCluster_tags
=== RUN   TestAccRedshiftCluster_forceNewUsername
=== PAUSE TestAccRedshiftCluster_forceNewUsername
=== RUN   TestAccRedshiftCluster_changeAvailabilityZone
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZone
=== RUN   TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
=== RUN   TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
=== RUN   TestAccRedshiftCluster_changeEncryption1
=== PAUSE TestAccRedshiftCluster_changeEncryption1
=== RUN   TestAccRedshiftCluster_changeEncryption2
=== PAUSE TestAccRedshiftCluster_changeEncryption2
=== RUN   TestAccRedshiftCluster_availabilityZoneRelocation
=== PAUSE TestAccRedshiftCluster_availabilityZoneRelocation
=== RUN   TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
=== PAUSE TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
=== CONT  TestAccRedshiftCluster_basic
=== CONT  TestAccRedshiftCluster_updateNodeType
=== CONT  TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
--- PASS: TestAccRedshiftCluster_basic (222.68s)
=== CONT  TestAccRedshiftCluster_availabilityZoneRelocation
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet (390.44s)
=== CONT  TestAccRedshiftCluster_changeEncryption2
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (456.19s)
=== CONT  TestAccRedshiftCluster_changeEncryption1
--- PASS: TestAccRedshiftCluster_updateNodeType (1428.13s)
=== CONT  TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
=== CONT  TestAccRedshiftCluster_changeAvailabilityZone
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (2.04s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (518.74s)
=== CONT  TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1651.28s)
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1640.72s)
=== CONT  TestAccRedshiftCluster_iamRoles
--- PASS: TestAccRedshiftCluster_loggingEnabled (336.16s)
=== CONT  TestAccRedshiftCluster_snapshotCopy
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (682.67s)
=== CONT  TestAccRedshiftCluster_forceNewUsername
--- PASS: TestAccRedshiftCluster_snapshotCopy (288.47s)
=== CONT  TestAccRedshiftCluster_publiclyAccessible
--- PASS: TestAccRedshiftCluster_iamRoles (402.34s)
=== CONT  TestAccRedshiftCluster_updateNodeCount
--- PASS: TestAccRedshiftCluster_publiclyAccessible (304.97s)
=== CONT  TestAccRedshiftCluster_tags
--- PASS: TestAccRedshiftCluster_forceNewUsername (503.93s)
=== CONT  TestAccRedshiftCluster_kmsKey
--- PASS: TestAccRedshiftCluster_tags (255.92s)
=== CONT  TestAccRedshiftCluster_enhancedVPCRoutingEnabled
--- PASS: TestAccRedshiftCluster_kmsKey (420.64s)
=== CONT  TestAccRedshiftCluster_withFinalSnapshot
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (649.53s)
=== CONT  TestAccRedshiftCluster_disappears
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (496.08s)
--- PASS: TestAccRedshiftCluster_disappears (247.65s)
--- PASS: TestAccRedshiftCluster_updateNodeCount (1669.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/redshift	4394.922s
…g from snapshot.

Acceptance test output:

% make testacc TESTS=TestAccRedshiftCluster_restoreFromSnapshot PKG=redshift ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshift/... -v -count 1 -parallel 3 -run='TestAccRedshiftCluster_restoreFromSnapshot'  -timeout 180m
=== RUN   TestAccRedshiftCluster_restoreFromSnapshot
=== PAUSE TestAccRedshiftCluster_restoreFromSnapshot
=== CONT  TestAccRedshiftCluster_restoreFromSnapshot
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (1408.34s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/redshift	1411.887s
@github-actions github-actions bot removed the size/M Managed by automation to categorize the size of a PR. label Mar 28, 2022
@github-actions github-actions bot added the size/XL Managed by automation to categorize the size of a PR. label Mar 28, 2022
@ewbankkit ewbankkit changed the title WIP : redshift cluster restore from snapshot Redshift cluster restore from snapshot: Correctly set number_of_nodes Mar 28, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTS=TestAccRedshiftCluster_ PKG=redshift ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshift/... -v -count 1 -parallel 3 -run='TestAccRedshiftCluster_'  -timeout 180m
=== RUN   TestAccRedshiftCluster_basic
=== PAUSE TestAccRedshiftCluster_basic
=== RUN   TestAccRedshiftCluster_disappears
=== PAUSE TestAccRedshiftCluster_disappears
=== RUN   TestAccRedshiftCluster_withFinalSnapshot
=== PAUSE TestAccRedshiftCluster_withFinalSnapshot
=== RUN   TestAccRedshiftCluster_kmsKey
=== PAUSE TestAccRedshiftCluster_kmsKey
=== RUN   TestAccRedshiftCluster_enhancedVPCRoutingEnabled
=== PAUSE TestAccRedshiftCluster_enhancedVPCRoutingEnabled
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== RUN   TestAccRedshiftCluster_iamRoles
=== PAUSE TestAccRedshiftCluster_iamRoles
=== RUN   TestAccRedshiftCluster_publiclyAccessible
=== PAUSE TestAccRedshiftCluster_publiclyAccessible
=== RUN   TestAccRedshiftCluster_updateNodeCount
=== PAUSE TestAccRedshiftCluster_updateNodeCount
=== RUN   TestAccRedshiftCluster_updateNodeType
=== PAUSE TestAccRedshiftCluster_updateNodeType
=== RUN   TestAccRedshiftCluster_tags
=== PAUSE TestAccRedshiftCluster_tags
=== RUN   TestAccRedshiftCluster_forceNewUsername
=== PAUSE TestAccRedshiftCluster_forceNewUsername
=== RUN   TestAccRedshiftCluster_changeAvailabilityZone
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZone
=== RUN   TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
=== RUN   TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
=== PAUSE TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
=== RUN   TestAccRedshiftCluster_changeEncryption1
=== PAUSE TestAccRedshiftCluster_changeEncryption1
=== RUN   TestAccRedshiftCluster_changeEncryption2
=== PAUSE TestAccRedshiftCluster_changeEncryption2
=== RUN   TestAccRedshiftCluster_availabilityZoneRelocation
=== PAUSE TestAccRedshiftCluster_availabilityZoneRelocation
=== RUN   TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
=== PAUSE TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
=== RUN   TestAccRedshiftCluster_restoreFromSnapshot
=== PAUSE TestAccRedshiftCluster_restoreFromSnapshot
=== CONT  TestAccRedshiftCluster_basic
=== CONT  TestAccRedshiftCluster_tags
=== CONT  TestAccRedshiftCluster_changeEncryption1
--- PASS: TestAccRedshiftCluster_basic (212.28s)
=== CONT  TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation
--- PASS: TestAccRedshiftCluster_tags (289.73s)
=== CONT  TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet (199.55s)
=== CONT  TestAccRedshiftCluster_changeAvailabilityZone
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (710.51s)
=== CONT  TestAccRedshiftCluster_forceNewUsername
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (486.82s)
=== CONT  TestAccRedshiftCluster_snapshotCopy
--- PASS: TestAccRedshiftCluster_snapshotCopy (225.55s)
=== CONT  TestAccRedshiftCluster_updateNodeType
--- PASS: TestAccRedshiftCluster_forceNewUsername (434.90s)
=== CONT  TestAccRedshiftCluster_updateNodeCount
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1753.88s)
=== CONT  TestAccRedshiftCluster_publiclyAccessible
--- PASS: TestAccRedshiftCluster_publiclyAccessible (314.06s)
=== CONT  TestAccRedshiftCluster_iamRoles
--- PASS: TestAccRedshiftCluster_iamRoles (256.81s)
=== CONT  TestAccRedshiftCluster_kmsKey
--- PASS: TestAccRedshiftCluster_updateNodeType (1247.41s)
=== CONT  TestAccRedshiftCluster_changeEncryption2
--- PASS: TestAccRedshiftCluster_kmsKey (270.27s)
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_updateNodeCount (1433.53s)
=== CONT  TestAccRedshiftCluster_enhancedVPCRoutingEnabled
--- PASS: TestAccRedshiftCluster_loggingEnabled (340.95s)
=== CONT  TestAccRedshiftCluster_availabilityZoneRelocation
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (396.61s)
=== CONT  TestAccRedshiftCluster_restoreFromSnapshot
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (552.18s)
=== CONT  TestAccRedshiftCluster_withFinalSnapshot
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (540.38s)
=== CONT  TestAccRedshiftCluster_disappears
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1631.69s)
=== CONT  TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (1.90s)
--- PASS: TestAccRedshiftCluster_disappears (263.51s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (1257.73s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/redshift	4449.238s

@ewbankkit
Copy link
Contributor

@imdhruva @thlacroix Thanks for the contribution 🎉 👏.

For testing I added an acceptance test case that:

  1. Creates a source cluster
  2. Deletes the source cluster, specifying a final snapshot ID
  3. Create a new cluster, restoring from the snapshot created in the previous step

Note that when restoring the new cluster from snapshot only certain combinations of node_type and number_of_nodes can be specified.

@ewbankkit ewbankkit merged commit ef6b346 into hashicorp:main Mar 29, 2022
@github-actions github-actions bot added this to the v4.9.0 milestone Mar 29, 2022
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This functionality has been released in v4.9.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. Thank you!

@github-actions
Copy link

github-actions bot commented May 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/redshift Issues and PRs that pertain to the redshift service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
4 participants