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: skip_final_snapshot updates state only #36635

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

jar-b
Copy link
Member

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

Description

Previously an update to skip_final_snapshot would trigger a call to the ModifyCluster API, which fails if no other arguments are modified.

Before:

Terraform will perform the following actions:

# aws_redshift_cluster.example will be updated in-place
~ resource "aws_redshift_cluster" "example" {
      id                                   = "tf-redshift-cluster"
    ~ skip_final_snapshot                  = false -> true
      tags                                 = {}
      # (38 unchanged attributes hidden)

      # (1 unchanged block hidden)
  }

Plan: 0 to add, 1 to change, 0 to destroy.
aws_redshift_cluster.example: Modifying... [id=tf-redshift-cluster] ╷
│ Error: modifying Redshift Cluster (tf-redshift-cluster): InvalidParameterCombination: No modifications were requested
│       status code: 400, request id: 0b087c95-ac6b-4ad6-8eed-ded497fb4a2e
│
│   with aws_redshift_cluster.example,
│   on main.tf line 13, in resource "aws_redshift_cluster" "example":
│   13: resource "aws_redshift_cluster" "example" {
│
╵

After:

Terraform will perform the following actions:

  # aws_redshift_cluster.example will be updated in-place
  ~ resource "aws_redshift_cluster" "example" {
        id                                   = "tf-redshift-cluster"
      ~ skip_final_snapshot                  = false -> true
        tags                                 = {}
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
aws_redshift_cluster.example: Modifying... [id=tf-redshift-cluster]
aws_redshift_cluster.example: Modifications complete after 1s [id=tf-redshift-cluster]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Relations

Relates #30160

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_changeAvailabilityZone_availabilityZoneRelocationNotSet (363.56s)
=== CONT  TestAccRedshiftCluster_updateNodeCount
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (367.74s)
=== CONT  TestAccRedshiftCluster_updateNodeType
--- PASS: TestAccRedshiftCluster_aqua (413.01s)
=== CONT  TestAccRedshiftCluster_iamRoles
--- PASS: TestAccRedshiftCluster_kmsKey (422.21s)
=== CONT  TestAccRedshiftCluster_changeAvailabilityZone
--- PASS: TestAccRedshiftCluster_disappears (423.58s)
=== CONT  TestAccRedshiftCluster_publiclyAccessible
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (437.10s)
--- PASS: TestAccRedshiftCluster_tags (445.99s)
--- PASS: TestAccRedshiftCluster_basic (449.41s)
--- PASS: TestAccRedshiftCluster_snapshotCopy (454.19s)
--- PASS: TestAccRedshiftCluster_loggingEnabled (478.74s)
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (479.88s)
--- PASS: TestAccRedshiftCluster_manageMasterPassword (531.65s)
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (663.40s)
--- PASS: TestAccRedshiftCluster_forceNewUsername (797.23s)
--- PASS: TestAccRedshiftCluster_iamRoles (406.81s)
--- PASS: TestAccRedshiftCluster_multiAZ (867.56s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (872.22s)
--- PASS: TestAccRedshiftCluster_publiclyAccessible (452.18s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshotARN (965.99s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (991.94s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (769.91s)
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1215.88s)
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1360.85s)
--- PASS: TestAccRedshiftCluster_updateNodeType (1281.25s)
--- PASS: TestAccRedshiftCluster_updateNodeCount (1425.33s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   1794.511s

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/XS Managed by automation to categorize the size of a PR. service/redshift Issues and PRs that pertain to the redshift service. labels Mar 28, 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 28, 2024
Previously an update to `skip_final_snapshot` would trigger a call to the ModifyCluster API, which fails if no other arguments are modified.

Before:

  ```
  Terraform will perform the following actions:

  # aws_redshift_cluster.example will be updated in-place
  ~ resource "aws_redshift_cluster" "example" {
        id                                   = "tf-redshift-cluster"
      ~ skip_final_snapshot                  = false -> true
        tags                                 = {}
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
aws_redshift_cluster.example: Modifying... [id=tf-redshift-cluster]
╷
│ Error: modifying Redshift Cluster (tf-redshift-cluster): InvalidParameterCombination: No modifications were requested
│       status code: 400, request id: 0b087c95-ac6b-4ad6-8eed-ded497fb4a2e
│
│   with aws_redshift_cluster.example,
│   on main.tf line 13, in resource "aws_redshift_cluster" "example":
│   13: resource "aws_redshift_cluster" "example" {
│
╵
```

After:

```
Terraform will perform the following actions:

  # aws_redshift_cluster.example will be updated in-place
  ~ resource "aws_redshift_cluster" "example" {
        id                                   = "tf-redshift-cluster"
      ~ skip_final_snapshot                  = false -> true
        tags                                 = {}
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
aws_redshift_cluster.example: Modifying... [id=tf-redshift-cluster]
aws_redshift_cluster.example: Modifications complete after 1s [id=tf-redshift-cluster]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
```
@jar-b jar-b force-pushed the b-redshift_cluster-no-modification-error branch from e539ec7 to 3175a5b Compare March 28, 2024 18:54
@jar-b jar-b marked this pull request as ready for review March 28, 2024 19:38
@jar-b jar-b merged commit aa89753 into main Mar 28, 2024
52 checks passed
@jar-b jar-b deleted the b-redshift_cluster-no-modification-error branch March 28, 2024 19:51
@github-actions github-actions bot added this to the v5.43.0 milestone Mar 28, 2024
github-actions bot pushed a commit that referenced this pull request Mar 28, 2024
Copy link

This functionality has been released in v5.43.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 28, 2024
Copy link

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 Apr 28, 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/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant