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

Add concurrency_mode parameter to aws_cloudformation_stack_set_instance #38498

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/38498.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_cloudformation_stack_set_instance: Add `concurrency_mode` argument
```
5 changes: 5 additions & 0 deletions internal/service/cloudformation/stack_set_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ func resourceStackSetInstance() *schema.Resource {
ValidateFunc: validation.IntBetween(1, 100),
ConflictsWith: []string{"operation_preferences.0.max_concurrent_count"},
},
"concurrency_mode": {
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: enum.Validate[awstypes.ConcurrencyMode](),
},
"region_concurrency_type": {
Type: schema.TypeString,
Optional: true,
Expand Down
2 changes: 2 additions & 0 deletions internal/service/cloudformation/stack_set_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func TestAccCloudFormationStackSetInstance_operationPreferences(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "operation_preferences.0.failure_tolerance_percentage", acctest.Ct0),
resource.TestCheckResourceAttr(resourceName, "operation_preferences.0.max_concurrent_count", acctest.Ct10),
resource.TestCheckResourceAttr(resourceName, "operation_preferences.0.max_concurrent_percentage", acctest.Ct0),
resource.TestCheckResourceAttr(resourceName, "operation_preferences.0.concurrency_mode", "SOFT_FAILURE_TOLERANCE"),
resource.TestCheckResourceAttr(resourceName, "operation_preferences.0.region_concurrency_type", ""),
),
},
Expand Down Expand Up @@ -853,6 +854,7 @@ resource "aws_cloudformation_stack_set_instance" "test" {
operation_preferences {
failure_tolerance_count = 1
max_concurrent_count = 10
concurrency_mode = "SOFT_FAILURE_TOLERANCE"
}

deployment_targets {
Expand Down
3 changes: 3 additions & 0 deletions internal/service/cloudformation/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ func expandOperationPreferences(tfMap map[string]interface{}) *awstypes.StackSet
if v, ok := tfMap["max_concurrent_percentage"].(int); ok {
apiObject.MaxConcurrentPercentage = aws.Int32(int32(v))
}
if v, ok := tfMap["concurrency_mode"].(string); ok && v != "" {
apiObject.ConcurrencyMode = awstypes.ConcurrencyMode(v)
}
if v, ok := tfMap["region_concurrency_type"].(string); ok && v != "" {
apiObject.RegionConcurrencyType = awstypes.RegionConcurrencyType(v)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ The `operation_preferences` configuration block supports the following arguments
* `failure_tolerance_percentage` - (Optional) Percentage of accounts, per Region, for which this stack operation can fail before AWS CloudFormation stops the operation in that Region.
* `max_concurrent_count` - (Optional) Maximum number of accounts in which to perform this operation at one time.
* `max_concurrent_percentage` - (Optional) Maximum percentage of accounts in which to perform this operation at one time.
* `concurrency_mode` - (Optional) Specifies how the concurrency level behaves during the operation execution. Valid values are `STRICT_FAILURE_TOLERANCE` and `SOFT_FAILURE_TOLERANCE`.
* `region_concurrency_type` - (Optional) Concurrency type of deploying StackSets operations in Regions, could be in parallel or one Region at a time. Valid values are `SEQUENTIAL` and `PARALLEL`.
* `region_order` - (Optional) Order of the Regions in where you want to perform the stack operation.

Expand Down
Loading