-
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: Add nil check for empty blocks to fix crashes for aws_ecs_cluster #36341
fix: Add nil check for empty blocks to fix crashes for aws_ecs_cluster #36341
Conversation
Community NoteVoting for Prioritization
For Submitters
|
c5fb306
to
c99de5f
Compare
c99de5f
to
008e409
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=TestAccECSCluster_configuration\|TestAccECSCluster_basic' PKG=ecs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 2 -run=TestAccECSCluster_configuration\|TestAccECSCluster_basic -timeout 360m
=== RUN TestAccECSCluster_basic
=== PAUSE TestAccECSCluster_basic
=== RUN TestAccECSCluster_configuration
=== PAUSE TestAccECSCluster_configuration
=== CONT TestAccECSCluster_basic
=== CONT TestAccECSCluster_configuration
--- PASS: TestAccECSCluster_basic (31.54s)
--- PASS: TestAccECSCluster_configuration (56.06s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecs 63.134s
@acwwat Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.41.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 is to fix provider crashes in three locations due to empty configuration blocks (
configuration
,execute_command_configuration
andlog_configuration
) being loaded asnil
into the list of blocks from the config during expansion. The AWS API also seems to set a default value for thelogging
argument in theexecute_command_configuration
block, so I also had to set a default value to avoid perpetual differences.Note: Since this is a widely used resource, I appreciate that a maintainer review this change to make sure I am not introducing any side effects. If there is anything I could do to help validate further, let me know.
Relations
Closes #36330
References
Referred to other resource code like that of
aws_openserach_domain
to see how similar cases are handled and follow suit.Output from Acceptance Testing