-
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
Ensure Sequential Update of Elastic Beanstalk Tags and Environment Properties #36074
Ensure Sequential Update of Elastic Beanstalk Tags and Environment Properties #36074
Conversation
Community NoteVoting for Prioritization
For Submitters
|
fc5c39b
to
4842e5c
Compare
4842e5c
to
1be3663
Compare
% make testacc TESTARGS='-run=TestAccElasticBeanstalkEnvironment_platformARN' PKG=elasticbeanstalk ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 20 -run=TestAccElasticBeanstalkEnvironment_platformARN -timeout 360m === RUN TestAccElasticBeanstalkEnvironment_platformARN === PAUSE TestAccElasticBeanstalkEnvironment_platformARN === CONT TestAccElasticBeanstalkEnvironment_platformARN --- PASS: TestAccElasticBeanstalkEnvironment_platformARN (521.22s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 528.417s
% make testacc TESTARGS='-run=TestAccElasticBeanstalkEnvironment_platformARN' PKG=elasticbeanstalk ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 20 -run=TestAccElasticBeanstalkEnvironment_platformARN -timeout 360m === RUN TestAccElasticBeanstalkEnvironment_platformARN === PAUSE TestAccElasticBeanstalkEnvironment_platformARN === CONT TestAccElasticBeanstalkEnvironment_platformARN environment_test.go:455: Step 3/3 error: Error running apply: exit status 1 Error: updating Elastic Beanstalk Environment (e-96qne4yupz): operation error Elastic Beanstalk: UpdateEnvironment, https response error StatusCode: 400, RequestID: 3dd120a1-00dc-4407-a4d8-87e42587c9fb, api error InvalidParameterValue: Environment named tf-acc-test-8006851858569271934 is in an invalid state for this operation. Must be Ready. with aws_elastic_beanstalk_environment.test, on terraform_plugin_test.tf line 149, in resource "aws_elastic_beanstalk_environment" "test": 149: resource "aws_elastic_beanstalk_environment" "test" { --- FAIL: TestAccElasticBeanstalkEnvironment_platformARN (414.31s) FAIL FAIL github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 421.358s FAIL make: *** [testacc] Error 1
…have been updated.
% make testacc TESTARGS='-run=TestAccElasticBeanstalkEnvironment_platformARN' PKG=elasticbeanstalk ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 20 -run=TestAccElasticBeanstalkEnvironment_platformARN -timeout 360m === RUN TestAccElasticBeanstalkEnvironment_platformARN === PAUSE TestAccElasticBeanstalkEnvironment_platformARN === CONT TestAccElasticBeanstalkEnvironment_platformARN --- PASS: TestAccElasticBeanstalkEnvironment_platformARN (570.56s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 580.939s
Before% make testacc TESTARGS='-run=TestAccElasticBeanstalkEnvironment_platformARN' PKG=elasticbeanstalk
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 20 -run=TestAccElasticBeanstalkEnvironment_platformARN -timeout 360m
=== RUN TestAccElasticBeanstalkEnvironment_platformARN
=== PAUSE TestAccElasticBeanstalkEnvironment_platformARN
=== CONT TestAccElasticBeanstalkEnvironment_platformARN
environment_test.go:455: Step 3/3 error: Error running apply: exit status 1
Error: updating Elastic Beanstalk Environment (e-96qne4yupz): operation error Elastic Beanstalk: UpdateEnvironment, https response error StatusCode: 400, RequestID: 3dd120a1-00dc-4407-a4d8-87e42587c9fb, api error InvalidParameterValue: Environment named tf-acc-test-8006851858569271934 is in an invalid state for this operation. Must be Ready.
with aws_elastic_beanstalk_environment.test,
on terraform_plugin_test.tf line 149, in resource "aws_elastic_beanstalk_environment" "test":
149: resource "aws_elastic_beanstalk_environment" "test" {
--- FAIL: TestAccElasticBeanstalkEnvironment_platformARN (414.31s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 421.358s
FAIL
make: *** [testacc] Error 1 After% make testacc TESTARGS='-run=TestAccElasticBeanstalkEnvironment_platformARN' PKG=elasticbeanstalk
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 20 -run=TestAccElasticBeanstalkEnvironment_platformARN -timeout 360m
=== RUN TestAccElasticBeanstalkEnvironment_platformARN
=== PAUSE TestAccElasticBeanstalkEnvironment_platformARN
=== CONT TestAccElasticBeanstalkEnvironment_platformARN
--- PASS: TestAccElasticBeanstalkEnvironment_platformARN (570.56s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 580.939s |
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=TestAccElasticBeanstalkEnvironment_' PKG=elasticbeanstalk ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 3 -run=TestAccElasticBeanstalkEnvironment_ -timeout 360m
=== RUN TestAccElasticBeanstalkEnvironment_basic
=== PAUSE TestAccElasticBeanstalkEnvironment_basic
=== RUN TestAccElasticBeanstalkEnvironment_disappears
=== PAUSE TestAccElasticBeanstalkEnvironment_disappears
=== RUN TestAccElasticBeanstalkEnvironment_tier
=== PAUSE TestAccElasticBeanstalkEnvironment_tier
=== RUN TestAccElasticBeanstalkEnvironment_cnamePrefix
=== PAUSE TestAccElasticBeanstalkEnvironment_cnamePrefix
=== RUN TestAccElasticBeanstalkEnvironment_beanstalkEnv
=== PAUSE TestAccElasticBeanstalkEnvironment_beanstalkEnv
=== RUN TestAccElasticBeanstalkEnvironment_resource
=== PAUSE TestAccElasticBeanstalkEnvironment_resource
=== RUN TestAccElasticBeanstalkEnvironment_tags
=== PAUSE TestAccElasticBeanstalkEnvironment_tags
=== RUN TestAccElasticBeanstalkEnvironment_changeStack
=== PAUSE TestAccElasticBeanstalkEnvironment_changeStack
=== RUN TestAccElasticBeanstalkEnvironment_update
=== PAUSE TestAccElasticBeanstalkEnvironment_update
=== RUN TestAccElasticBeanstalkEnvironment_label
=== PAUSE TestAccElasticBeanstalkEnvironment_label
=== RUN TestAccElasticBeanstalkEnvironment_settingWithJSONValue
=== PAUSE TestAccElasticBeanstalkEnvironment_settingWithJSONValue
=== RUN TestAccElasticBeanstalkEnvironment_platformARN
=== PAUSE TestAccElasticBeanstalkEnvironment_platformARN
=== CONT TestAccElasticBeanstalkEnvironment_basic
=== CONT TestAccElasticBeanstalkEnvironment_tags
=== CONT TestAccElasticBeanstalkEnvironment_label
--- PASS: TestAccElasticBeanstalkEnvironment_basic (387.97s)
=== CONT TestAccElasticBeanstalkEnvironment_platformARN
--- PASS: TestAccElasticBeanstalkEnvironment_label (449.41s)
=== CONT TestAccElasticBeanstalkEnvironment_settingWithJSONValue
--- PASS: TestAccElasticBeanstalkEnvironment_tags (526.05s)
=== CONT TestAccElasticBeanstalkEnvironment_update
--- PASS: TestAccElasticBeanstalkEnvironment_settingWithJSONValue (441.02s)
=== CONT TestAccElasticBeanstalkEnvironment_cnamePrefix
--- PASS: TestAccElasticBeanstalkEnvironment_platformARN (647.73s)
=== CONT TestAccElasticBeanstalkEnvironment_resource
--- PASS: TestAccElasticBeanstalkEnvironment_update (624.86s)
=== CONT TestAccElasticBeanstalkEnvironment_beanstalkEnv
--- PASS: TestAccElasticBeanstalkEnvironment_cnamePrefix (393.06s)
=== CONT TestAccElasticBeanstalkEnvironment_changeStack
--- PASS: TestAccElasticBeanstalkEnvironment_resource (352.33s)
=== CONT TestAccElasticBeanstalkEnvironment_disappears
--- PASS: TestAccElasticBeanstalkEnvironment_beanstalkEnv (417.17s)
=== CONT TestAccElasticBeanstalkEnvironment_tier
--- PASS: TestAccElasticBeanstalkEnvironment_changeStack (479.36s)
--- PASS: TestAccElasticBeanstalkEnvironment_disappears (578.60s)
--- PASS: TestAccElasticBeanstalkEnvironment_tier (475.30s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 2050.511s
@alexknez Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.40.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 addresses an issue encountered in Elastic Beanstalk environments. Previously, when tags were updated concurrently with environment properties, the provider would fail, presenting the following error message:
This error arose due to the sequence of API calls involved in the process:
The UpdateTagsForResource call preceded UpdateEnvironment, but it required additional time for changes to propagate throughout the Beanstalk environment.
Changes Made
To resolve this issue, this PR introduces a wait condition following the
UpdateTagsForResource
call to ensure its completion before triggeringUpdateEnvironment
. By adding this wait condition, we ensure that the environment is in the correct state to receive subsequent updates, thereby preventing the aforementioned error.Relations
Closes #32284
Closes #31575
References
Output from Acceptance Testing