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

r/aws_redshift_cluster: allow snapshot_copy modifications #36655

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Mar 29, 2024

Description

This change fixes an issue preventing clusters with the snapshot_copy block configured from updating any nested arguments.

Before:

% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_snapshotCopy
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_snapshotCopy'  -timeout 360m
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== CONT  TestAccRedshiftCluster_snapshotCopy
    cluster_test.go:311: Step 2/3 error: Error running apply: exit status 1

        Error: updating Redshift Cluster (tf-acc-test-3261690877562655687) snapshot_copy: enabling snapshot copy: SnapshotCopyAlreadyEnabledFault: Snapshot Copy is already enabled on Cluster tf-acc-test-3261690877562655687
                status code: 400, request id: cf5d914b-3146-4a66-8335-a44153800324

          with aws_redshift_cluster.test,
          on terraform_plugin_test.tf line 33, in resource aws_redshift_cluster test:
          33: resource aws_redshift_cluster test {

--- FAIL: TestAccRedshiftCluster_snapshotCopy (428.46s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/redshift   434.035s
FAIL
make: *** [testacc] Error 1

After:

% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_snapshotCopy
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_snapshotCopy'  -timeout 360m
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== CONT  TestAccRedshiftCluster_snapshotCopy
--- PASS: TestAccRedshiftCluster_snapshotCopy (431.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   436.505s

Relations

Closes #36636

References

Output from Acceptance Testing

% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_'  -timeout 360m

--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (382.40s)
=== CONT  TestAccRedshiftCluster_disappears
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet (382.71s)
=== CONT  TestAccRedshiftCluster_withFinalSnapshot
--- PASS: TestAccRedshiftCluster_basic (418.72s)
=== CONT  TestAccRedshiftCluster_aqua
--- PASS: TestAccRedshiftCluster_kmsKey (432.77s)
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (444.95s)
=== CONT  TestAccRedshiftCluster_enhancedVPCRoutingEnabled
--- PASS: TestAccRedshiftCluster_manageMasterPassword (450.88s)
--- PASS: TestAccRedshiftCluster_publiclyAccessible (452.54s)
--- PASS: TestAccRedshiftCluster_iamRoles (459.36s)
--- PASS: TestAccRedshiftCluster_snapshotCopy (460.15s)
--- PASS: TestAccRedshiftCluster_tags (551.91s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (766.95s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (767.07s)
--- PASS: TestAccRedshiftCluster_disappears (416.75s)
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (463.58s)
--- PASS: TestAccRedshiftCluster_loggingEnabled (446.24s)
--- PASS: TestAccRedshiftCluster_forceNewUsername (902.68s)
--- PASS: TestAccRedshiftCluster_multiAZ (944.06s)
--- PASS: TestAccRedshiftCluster_aqua (529.97s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshotARN (1011.97s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (1044.51s)
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (623.74s)
--- PASS: TestAccRedshiftCluster_updateNodeCount (1314.86s)
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1351.20s)
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1489.08s)
--- PASS: TestAccRedshiftCluster_updateNodeType (1531.73s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   1537.226s

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/redshift Issues and PRs that pertain to the redshift service. labels Mar 29, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 29, 2024
@jar-b jar-b force-pushed the b-redshift_cluster-snapshot_copy_update branch from de5f99f to 53d65e4 Compare March 29, 2024 17:23
This change fixes an issue preventing clusters with the `snapshot_copy` block configured from updating any nested arguments.

Before:

```console
% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_snapshotCopy
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_snapshotCopy'  -timeout 360m
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== CONT  TestAccRedshiftCluster_snapshotCopy
    cluster_test.go:311: Step 2/3 error: Error running apply: exit status 1

        Error: updating Redshift Cluster (tf-acc-test-3261690877562655687) snapshot_copy: enabling snapshot copy: SnapshotCopyAlreadyEnabledFault: Snapshot Copy is already enabled on Cluster tf-acc-test-3261690877562655687
                status code: 400, request id: cf5d914b-3146-4a66-8335-a44153800324

          with aws_redshift_cluster.test,
          on terraform_plugin_test.tf line 33, in resource aws_redshift_cluster test:
          33: resource aws_redshift_cluster test {

--- FAIL: TestAccRedshiftCluster_snapshotCopy (428.46s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/redshift   434.035s
FAIL
make: *** [testacc] Error 1
```

After:

```console
% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_snapshotCopy
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_snapshotCopy'  -timeout 360m
=== RUN   TestAccRedshiftCluster_snapshotCopy
=== PAUSE TestAccRedshiftCluster_snapshotCopy
=== CONT  TestAccRedshiftCluster_snapshotCopy
--- PASS: TestAccRedshiftCluster_snapshotCopy (431.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   436.505s
```

```console
% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_'  -timeout 360m

--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (382.40s)
=== CONT  TestAccRedshiftCluster_disappears
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet (382.71s)
=== CONT  TestAccRedshiftCluster_withFinalSnapshot
--- PASS: TestAccRedshiftCluster_basic (418.72s)
=== CONT  TestAccRedshiftCluster_aqua
--- PASS: TestAccRedshiftCluster_kmsKey (432.77s)
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (444.95s)
=== CONT  TestAccRedshiftCluster_enhancedVPCRoutingEnabled
--- PASS: TestAccRedshiftCluster_manageMasterPassword (450.88s)
--- PASS: TestAccRedshiftCluster_publiclyAccessible (452.54s)
--- PASS: TestAccRedshiftCluster_iamRoles (459.36s)
--- PASS: TestAccRedshiftCluster_snapshotCopy (460.15s)
--- PASS: TestAccRedshiftCluster_tags (551.91s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (766.95s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (767.07s)
--- PASS: TestAccRedshiftCluster_disappears (416.75s)
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (463.58s)
--- PASS: TestAccRedshiftCluster_loggingEnabled (446.24s)
--- PASS: TestAccRedshiftCluster_forceNewUsername (902.68s)
--- PASS: TestAccRedshiftCluster_multiAZ (944.06s)
--- PASS: TestAccRedshiftCluster_aqua (529.97s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshotARN (1011.97s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (1044.51s)
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (623.74s)
--- PASS: TestAccRedshiftCluster_updateNodeCount (1314.86s)
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1351.20s)
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1489.08s)
--- PASS: TestAccRedshiftCluster_updateNodeType (1531.73s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   1537.226s
```
@jar-b jar-b force-pushed the b-redshift_cluster-snapshot_copy_update branch from 53d65e4 to 0f9f95d Compare March 29, 2024 17:24
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 🚀.

@jar-b jar-b merged commit f6191f1 into main Mar 29, 2024
37 checks passed
@jar-b jar-b deleted the b-redshift_cluster-snapshot_copy_update branch March 29, 2024 20:17
@github-actions github-actions bot added this to the v5.44.0 milestone Mar 29, 2024
github-actions bot pushed a commit that referenced this pull request Mar 29, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

This functionality has been released in v5.44.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!

Copy link

github-actions bot commented May 7, 2024

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 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/redshift Issues and PRs that pertain to the redshift service. size/S 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
Development

Successfully merging this pull request may close these issues.

[Bug]: r/aws_redshift_cluster: Enabled snapshot copy settings fail to update
2 participants