-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Fix expired statements during redshift-data state update #26343
Fix expired statements during redshift-data state update #26343
Conversation
…is expired. when this happens, assume the statement exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @rockpunk 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Is there a reason why this doesn't get merged? |
Probably a lack of community votes. I have raised this to our internal aws reps and will ping them again about it. In the meantime, future readers should continue to add a 👍 to the pr description above if they want this merged. |
Any updates so far? The |
please merge this , the update : As a workaround , you can use |
Any news on this? It is a big issue! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccRedshiftDataStatement_' PKG=redshiftdata ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshiftdata/... -v -count 1 -parallel 2 -run=TestAccRedshiftDataStatement_ -timeout 180m
=== RUN TestAccRedshiftDataStatement_basic
=== PAUSE TestAccRedshiftDataStatement_basic
=== RUN TestAccRedshiftDataStatement_workgroup
=== PAUSE TestAccRedshiftDataStatement_workgroup
=== CONT TestAccRedshiftDataStatement_basic
=== CONT TestAccRedshiftDataStatement_workgroup
--- PASS: TestAccRedshiftDataStatement_basic (505.04s)
--- PASS: TestAccRedshiftDataStatement_workgroup (621.16s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/redshiftdata 626.763s
@rockpunk Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.65.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! |
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. |
Community Note
Closes #25882
After a redshift data statement is created,
aws redshift-data describe-statement
will only return a result for a short period of time when refreshing terraform state. After a while, it doesn't actually find the old statement, so terraform plan will fail trying to refresh the state:This PR attempts to fix the issue by catching
ValidationExceptions
related to expired statements, and returning a dummy response that allows terraform state refresh to continue.One impact of this change is that all expired statements will NOW BE REPLACED (the statements will be re-run) on next plan application.
If you don't want the statements to be re-run, use the
ignore_changes
lifecycle:Output from acceptance testing: