diff --git a/internal/service/autoscaling/group.go b/internal/service/autoscaling/group.go index 7b462dab495..1236f7a14a8 100644 --- a/internal/service/autoscaling/group.go +++ b/internal/service/autoscaling/group.go @@ -256,6 +256,12 @@ func ResourceGroup() *schema.Resource { Default: 90, ValidateFunc: validation.IntBetween(0, 100), }, + "max_healthy_percentage": { + Type: schema.TypeInt, + Optional: true, + Default: 100, + ValidateFunc: validation.IntBetween(100, 200), + }, "scale_in_protected_instances": { Type: schema.TypeString, Optional: true, @@ -3378,6 +3384,10 @@ func expandRefreshPreferences(tfMap map[string]interface{}) *autoscaling.Refresh apiObject.MinHealthyPercentage = aws.Int64(int64(v)) } + if v, ok := tfMap["max_healthy_percentage"].(int); ok { + apiObject.MaxHealthyPercentage = aws.Int64(int64(v)) + } + if v, ok := tfMap["scale_in_protected_instances"].(string); ok { apiObject.ScaleInProtectedInstances = aws.String(v) } diff --git a/internal/service/autoscaling/group_migrate.go b/internal/service/autoscaling/group_migrate.go index 8bb7d144b1e..daa0b6d81ab 100644 --- a/internal/service/autoscaling/group_migrate.go +++ b/internal/service/autoscaling/group_migrate.go @@ -150,6 +150,11 @@ func resourceGroupV0() *schema.Resource { Optional: true, Default: 90, }, + "max_healthy_percentage": { + Type: schema.TypeInt, + Optional: true, + Default: 100, + }, "skip_matching": { Type: schema.TypeBool, Optional: true, diff --git a/website/docs/cdktf/python/r/autoscaling_group.html.markdown b/website/docs/cdktf/python/r/autoscaling_group.html.markdown index 62ae2ee0ac7..8989ddc2534 100644 --- a/website/docs/cdktf/python/r/autoscaling_group.html.markdown +++ b/website/docs/cdktf/python/r/autoscaling_group.html.markdown @@ -759,6 +759,7 @@ This configuration block supports the following: - `checkpoint_percentages` - (Optional) List of percentages for each checkpoint. Values must be unique and in ascending order. To replace all instances, the final number must be `100`. - `instance_warmup` - (Optional) Number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group's health check grace period. - `min_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `90`. + - `max_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that can be healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `100`. - `skip_matching` - (Optional) Replace instances that already have your desired configuration. Defaults to `false`. - `auto_rollback` - (Optional) Automatically rollback if instance refresh fails. Defaults to `false`. This option may only be set to `true` when specifying a `launch_template` or `mixed_instances_policy`. - `scale_in_protected_instances` - (Optional) Behavior when encountering instances protected from scale in are found. Available behaviors are `Refresh`, `Ignore`, and `Wait`. Default is `Ignore`. diff --git a/website/docs/cdktf/typescript/r/autoscaling_group.html.markdown b/website/docs/cdktf/typescript/r/autoscaling_group.html.markdown index 146e8f0f1da..313cd9b1c9d 100644 --- a/website/docs/cdktf/typescript/r/autoscaling_group.html.markdown +++ b/website/docs/cdktf/typescript/r/autoscaling_group.html.markdown @@ -814,6 +814,7 @@ This configuration block supports the following: - `checkpoint_percentages` - (Optional) List of percentages for each checkpoint. Values must be unique and in ascending order. To replace all instances, the final number must be `100`. - `instance_warmup` - (Optional) Number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group's health check grace period. - `min_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `90`. + - `max_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that can be healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `90`. - `skip_matching` - (Optional) Replace instances that already have your desired configuration. Defaults to `false`. - `auto_rollback` - (Optional) Automatically rollback if instance refresh fails. Defaults to `false`. This option may only be set to `true` when specifying a `launch_template` or `mixed_instances_policy`. - `scale_in_protected_instances` - (Optional) Behavior when encountering instances protected from scale in are found. Available behaviors are `Refresh`, `Ignore`, and `Wait`. Default is `Ignore`. diff --git a/website/docs/r/autoscaling_group.html.markdown b/website/docs/r/autoscaling_group.html.markdown index 35202d935d5..8d2a1d3b29c 100644 --- a/website/docs/r/autoscaling_group.html.markdown +++ b/website/docs/r/autoscaling_group.html.markdown @@ -663,6 +663,7 @@ This configuration block supports the following: - `checkpoint_percentages` - (Optional) List of percentages for each checkpoint. Values must be unique and in ascending order. To replace all instances, the final number must be `100`. - `instance_warmup` - (Optional) Number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group's health check grace period. - `min_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `90`. + - `max_healthy_percentage` - (Optional) Amount of capacity in the Auto Scaling group that can be healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `100`. - `skip_matching` - (Optional) Replace instances that already have your desired configuration. Defaults to `false`. - `auto_rollback` - (Optional) Automatically rollback if instance refresh fails. Defaults to `false`. This option may only be set to `true` when specifying a `launch_template` or `mixed_instances_policy`. - `scale_in_protected_instances` - (Optional) Behavior when encountering instances protected from scale in are found. Available behaviors are `Refresh`, `Ignore`, and `Wait`. Default is `Ignore`.