-
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
b/aws_redshiftserverless_workgroup: Fix base_capacity, max_capacity ordered updates and max_capacity limit removal #36032
Conversation
Community NoteVoting for Prioritization
For Submitters
|
b6901f0
to
d6ab53f
Compare
…rdered updates and max_capacity limit removal
d6ab53f
to
e024709
Compare
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=TestAccRedshiftServerlessWorkgroup_' PKG=redshiftserverless ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshiftserverless/... -v -count 1 -parallel 3 -run=TestAccRedshiftServerlessWorkgroup_ -timeout 360m
=== RUN TestAccRedshiftServerlessWorkgroup_basic
=== PAUSE TestAccRedshiftServerlessWorkgroup_basic
=== RUN TestAccRedshiftServerlessWorkgroup_baseAndMaxCapacityAndPubliclyAccessible
=== PAUSE TestAccRedshiftServerlessWorkgroup_baseAndMaxCapacityAndPubliclyAccessible
=== RUN TestAccRedshiftServerlessWorkgroup_configParameters
=== PAUSE TestAccRedshiftServerlessWorkgroup_configParameters
=== RUN TestAccRedshiftServerlessWorkgroup_tags
=== PAUSE TestAccRedshiftServerlessWorkgroup_tags
=== RUN TestAccRedshiftServerlessWorkgroup_disappears
=== PAUSE TestAccRedshiftServerlessWorkgroup_disappears
=== RUN TestAccRedshiftServerlessWorkgroup_port
=== PAUSE TestAccRedshiftServerlessWorkgroup_port
=== CONT TestAccRedshiftServerlessWorkgroup_basic
=== CONT TestAccRedshiftServerlessWorkgroup_tags
=== CONT TestAccRedshiftServerlessWorkgroup_configParameters
--- PASS: TestAccRedshiftServerlessWorkgroup_basic (248.60s)
=== CONT TestAccRedshiftServerlessWorkgroup_baseAndMaxCapacityAndPubliclyAccessible
--- PASS: TestAccRedshiftServerlessWorkgroup_tags (283.02s)
=== CONT TestAccRedshiftServerlessWorkgroup_port
--- PASS: TestAccRedshiftServerlessWorkgroup_configParameters (356.22s)
=== CONT TestAccRedshiftServerlessWorkgroup_disappears
--- PASS: TestAccRedshiftServerlessWorkgroup_port (253.62s)
--- PASS: TestAccRedshiftServerlessWorkgroup_disappears (291.94s)
--- PASS: TestAccRedshiftServerlessWorkgroup_baseAndMaxCapacityAndPubliclyAccessible (1175.57s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless 1431.231s
@marcinbelczewski Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.39.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. |
Description
This PR fixes base_capacity and max_capacity update logic, where due to the nature of AWS API, the ordering of updates depends on the current and the new values of base_capacity and max_capacity.
Also, PR implements a fix allowing for
max_capacity
limit removal. AWS API behavior for this is non-idempotent and as of now unclearly documented.Relations
Closes #36030
Closes #36031
References
UpdateWorkgroup request in AWS API.
I have also received guidance from AWS Support regarding the procedure for removing maximum capacity. To do this, the UpdateWorkgroup request must include a -1 value for maxCapacity. However, the API is not idempotent, meaning that submitting a repeated request with a -1 value for maxCapacity will result in an error. This poses a challenge for the implementation by providers.
Output from Acceptance Testing
% make testacc TESTS=TestAccRedshiftServerlessWorkgroup_baseAndMaxCapacityAndPubliclyAccessible PKG=redshiftserverless
Warning! The acceptance test may occasionally encounter a failure with the error: An error occurred (ConflictException) when calling the UpdateWorkgroup operation: There is an operation running on the workgroup. Try to update it later. This issue appears to stem from a suspected bug in the AWS APIs. Despite the
GetWorkgroup
API request indicating the workgroup isAVAILABLE
after recent updates, an immediate subsequentUpdateWorkgroup
request can still fail. This suggests a race condition within the API. I have reported this issue to AWS Support and have also followed up with Amazon Technical Account Managers (TAMs) accessible through my workplace.