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

stack_set.operation_preferences.failure_tolerance_count can be zero #24250

Merged
merged 4 commits into from
Apr 15, 2022
Merged

stack_set.operation_preferences.failure_tolerance_count can be zero #24250

merged 4 commits into from
Apr 15, 2022

Conversation

MarkCBell
Copy link
Contributor

@MarkCBell MarkCBell commented Apr 14, 2022

Currently, an aws_cloudformation_stack_set with:

  operation_preferences {
    failure_tolerance_count = 0
    max_concurrent_percentage = 100
  }

fails with Validation Error: Exactly one of FailureTolerancePercentage and FailureToleranceCount must be specified since both parameters are present. This is because currently the FailureToleranceCount and FailureTolerancePercentage attributes are both set (possibly to a default value of 0) and then one is removed if it is zero and the other is non-zero. Therefore with the operation_preferences block above both remain, leading to the Validation Error being raised. This PR removes the requirement that the other be non-zero and so allows the above operation_preferences block to work.

Note that although this does not apply to max_concurrent_percentage / max_concurrent_count since at least one of these must be at least one, I propose making the same change there just to keep the logic the same.

@github-actions github-actions bot added service/cloudformation Issues and PRs that pertain to the cloudformation service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Apr 14, 2022
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/XS Managed by automation to categorize the size of a PR. labels Apr 15, 2022
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 15, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTS=TestAccCloudFormationStackSet_operationPreferences PKG=cloudformation
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudformation/... -v -count 1 -parallel 20 -run='TestAccCloudFormationStackSet_operationPreferences'  -timeout 180m
=== RUN   TestAccCloudFormationStackSet_operationPreferences
=== PAUSE TestAccCloudFormationStackSet_operationPreferences
=== CONT  TestAccCloudFormationStackSet_operationPreferences
--- PASS: TestAccCloudFormationStackSet_operationPreferences (125.20s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation	128.933s

@ewbankkit
Copy link
Contributor

@MarkCBell Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 84dc634 into hashicorp:main Apr 15, 2022
@github-actions github-actions bot added this to the v4.11.0 milestone Apr 15, 2022
@MarkCBell MarkCBell deleted the b-operation_preferences-logic branch April 21, 2022 19:03
@github-actions
Copy link

This functionality has been released in v4.11.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
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 May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/cloudformation Issues and PRs that pertain to the cloudformation service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants