From 3d8c5c5d7c8e067d06e3c862a5ba9de2641e9cfd Mon Sep 17 00:00:00 2001 From: SevenEarth <45937856+SevenEarth@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:25:35 +0800 Subject: [PATCH] fix(as): [121458126] `tencentcloud_as_scaling_group` support new params (#3048) * add * add --- .changelog/3048.txt | 3 + go.mod | 2 +- go.sum | 2 + tencentcloud/services/as/extension_as.go | 5 ++ .../as/resource_tc_as_scaling_group.go | 87 +++++++++++++------ .../as/resource_tc_as_scaling_group.md | 31 ++++--- .../services/as/service_tencentcloud_as.go | 3 + .../tencentcloud/as/v20180419/models.go | 7 +- vendor/modules.txt | 2 +- website/docs/r/as_scaling_group.html.markdown | 33 ++++--- 10 files changed, 120 insertions(+), 55 deletions(-) create mode 100644 .changelog/3048.txt diff --git a/.changelog/3048.txt b/.changelog/3048.txt new file mode 100644 index 0000000000..1e12acae5c --- /dev/null +++ b/.changelog/3048.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_as_scaling_group: support `replace_mode`, `desired_capacity_sync_with_max_min_size` params +``` diff --git a/go.mod b/go.mod index 3c15e7b888..d235d716a9 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.763 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.825 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1052 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1071 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.1071 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.825 diff --git a/go.sum b/go.sum index 5eade148bf..b44ecf4f34 100644 --- a/go.sum +++ b/go.sum @@ -828,6 +828,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.825 h1:yiC2lsZ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.825/go.mod h1:6qtSa8OZKwJOWoOCYWVZd6+T62O96AxbPll0I43d4yw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1052 h1:d7eK/iFBAL1P75UWcc+wupp2/W1KQHdTxB/YpJTaoUA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1052/go.mod h1:o/8YQckpRRJ12COW2g9J9Fx+v5noOAsHkKVQpTctM+g= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1071 h1:XtAPtAaj4rxUnxhLHhwk104R7ThGQI1E7Hnub4YXCB8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1071/go.mod h1:KiAIwNj6ovl/d1WOM7WFNdW6s9TsbYCq9xksjOQsQ7k= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824 h1:DVKvZ6h+qd7tadUrCjVAkCCmE3TsbK2ZmwGd3AJcpWc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824/go.mod h1:DvBpDX/qdJG4KKLeULmRvhAjPYiw8za0HeTSu2y/lFw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.1051 h1:ZwWmhAxXd88JDPs/8s2qW9SJblXNhIXWKWfeW7jtjlc= diff --git a/tencentcloud/services/as/extension_as.go b/tencentcloud/services/as/extension_as.go index a15094b0fa..b7a4731094 100644 --- a/tencentcloud/services/as/extension_as.go +++ b/tencentcloud/services/as/extension_as.go @@ -181,6 +181,11 @@ const ( SCALING_MODE_WAKE_UP_STOPPED = "WAKE_UP_STOPPED_SCALING" ) +const ( + REPLACE_MODE_RECREATE = "RECREATE" + REPLACE_MODE_RESET = "RESET" +) + const ( REFRESH_ACTIVITIES_SUCCESSFUL = "SUCCESSFUL" ) diff --git a/tencentcloud/services/as/resource_tc_as_scaling_group.go b/tencentcloud/services/as/resource_tc_as_scaling_group.go index c15304db56..394ab99768 100644 --- a/tencentcloud/services/as/resource_tc_as_scaling_group.go +++ b/tencentcloud/services/as/resource_tc_as_scaling_group.go @@ -158,22 +158,32 @@ func ResourceTencentCloudAsScalingGroup() *schema.Resource { ValidateFunc: tccommon.ValidateAllowedStringValue([]string{SCALING_GROUP_RETRY_POLICY_IMMEDIATE_RETRY, SCALING_GROUP_RETRY_POLICY_INCREMENTAL_INTERVALS}), }, - "scaling_mode": { - Type: schema.TypeString, - Optional: true, - Description: "Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: `CLASSIC_SCALING`, `WAKE_UP_STOPPED_SCALING`. Default: `CLASSIC_SCALING`.", - }, // Service Settings "replace_monitor_unhealthy": { Type: schema.TypeBool, Optional: true, Description: "Enables unhealthy instance replacement. If set to `true`, AS will replace instances that are flagged as unhealthy by Cloud Monitor.", }, + "scaling_mode": { + Type: schema.TypeString, + Optional: true, + Description: "Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: `CLASSIC_SCALING`, `WAKE_UP_STOPPED_SCALING`. Default: `CLASSIC_SCALING`.", + }, "replace_load_balancer_unhealthy": { Type: schema.TypeBool, Optional: true, Description: "Enable unhealthy instance replacement. If set to `true`, AS will replace instances that are found unhealthy in the CLB health check.", }, + "replace_mode": { + Type: schema.TypeString, + Optional: true, + Description: "Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained.", + }, + "desired_capacity_sync_with_max_min_size": { + Type: schema.TypeBool, + Optional: true, + Description: "The expected number of instances is synchronized with the maximum and minimum values. The default value is `False`. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed.", + }, "health_check_type": { Type: schema.TypeString, Optional: true, @@ -315,20 +325,28 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter } var ( - scalingMode = d.Get("scaling_mode").(string) - replaceMonitorUnhealthy = d.Get("replace_monitor_unhealthy").(bool) - replaceLBUnhealthy = d.Get("replace_load_balancer_unhealthy").(bool) + replaceMonitorUnhealthy = d.Get("replace_monitor_unhealthy").(bool) + scalingMode = d.Get("scaling_mode").(string) + replaceLBUnhealthy = d.Get("replace_load_balancer_unhealthy").(bool) + replaceMode = d.Get("replace_mode").(string) + desiredCapacitySyncWithMaxMinSize = d.Get("desired_capacity_sync_with_max_min_size").(bool) ) - if scalingMode != "" || replaceMonitorUnhealthy || replaceLBUnhealthy { + if replaceMonitorUnhealthy || scalingMode != "" || replaceLBUnhealthy || replaceMode != "" || desiredCapacitySyncWithMaxMinSize { if scalingMode == "" { scalingMode = SCALING_MODE_CLASSIC } + if replaceMode == "" { + replaceMode = REPLACE_MODE_RECREATE + } + request.ServiceSettings = &as.ServiceSettings{ - ScalingMode: &scalingMode, - ReplaceMonitorUnhealthy: &replaceMonitorUnhealthy, - ReplaceLoadBalancerUnhealthy: &replaceLBUnhealthy, + ReplaceMonitorUnhealthy: &replaceMonitorUnhealthy, + ScalingMode: &scalingMode, + ReplaceLoadBalancerUnhealthy: &replaceLBUnhealthy, + ReplaceMode: &replaceMode, + DesiredCapacitySyncWithMaxMinSize: &desiredCapacitySyncWithMaxMinSize, } } @@ -356,8 +374,8 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) - if response.Response.AutoScalingGroupId == nil { - err = fmt.Errorf("Auto scaling group id is nil") + if response == nil || response.Response == nil || response.Response.AutoScalingGroupId == nil { + err = fmt.Errorf("Create auto scaling group failed, Auto scaling group id is nil.") return resource.NonRetryableError(err) } @@ -378,7 +396,7 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter if errRet != nil { return tccommon.RetryError(errRet, tccommon.InternalError) } - if scalingGroup != nil && *scalingGroup.InActivityStatus == SCALING_GROUP_NOT_IN_ACTIVITY_STATUS { + if scalingGroup != nil && scalingGroup.InActivityStatus != nil && *scalingGroup.InActivityStatus == SCALING_GROUP_NOT_IN_ACTIVITY_STATUS { return nil } return resource.RetryableError(fmt.Errorf("scaling group status is %s, retry...", *scalingGroup.InActivityStatus)) @@ -445,18 +463,26 @@ func resourceTencentCloudAsScalingGroupRead(d *schema.ResourceData, meta interfa _ = d.Set("multi_zone_subnet_policy", scalingGroup.MultiZoneSubnetPolicy) } - if v := d.Get("scaling_mode"); v != "" { - _ = d.Set("scaling_mode", v.(string)) - } - if v, ok := d.GetOk("replace_monitor_unhealthy"); ok { _ = d.Set("replace_monitor_unhealthy", v.(bool)) } + if v := d.Get("scaling_mode"); v != "" { + _ = d.Set("scaling_mode", v.(string)) + } + if v, ok := d.GetOk("replace_load_balancer_unhealthy"); ok { _ = d.Set("replace_load_balancer_unhealthy", v.(bool)) } + if v := d.Get("replace_mode"); v != "" { + _ = d.Set("replace_mode", v.(string)) + } + + if v, ok := d.GetOk("desired_capacity_sync_with_max_min_size"); ok { + _ = d.Set("desired_capacity_sync_with_max_min_size", v.(bool)) + } + if scalingGroup.ForwardLoadBalancerSet != nil && len(scalingGroup.ForwardLoadBalancerSet) > 0 { forwardLoadBalancers := make([]map[string]interface{}, 0, len(scalingGroup.ForwardLoadBalancerSet)) for _, v := range scalingGroup.ForwardLoadBalancerSet { @@ -578,20 +604,29 @@ func resourceTencentCloudAsScalingGroupUpdate(d *schema.ResourceData, meta inter request.MultiZoneSubnetPolicy = helper.String(d.Get("multi_zone_subnet_policy").(string)) } - if d.HasChange("scaling_mode") || - d.HasChange("replace_monitor_unhealthy") || - d.HasChange("replace_load_balancer_unhealthy") { - updateAttrs = append(updateAttrs, "scaling_mode", "replace_monitor_unhealthy", "replace_load_balancer_unhealthy") + if d.HasChange("replace_monitor_unhealthy") || + d.HasChange("scaling_mode") || + d.HasChange("replace_load_balancer_unhealthy") || + d.HasChange("replace_mode") || + d.HasChange("desired_capacity_sync_with_max_min_size") { + updateAttrs = append(updateAttrs, "replace_monitor_unhealthy", "scaling_mode", "replace_load_balancer_unhealthy", "replace_mode", "desired_capacity_sync_with_max_min_size") scalingMode := d.Get("scaling_mode").(string) + replaceMode := d.Get("replace_mode").(string) if scalingMode == "" { scalingMode = SCALING_MODE_CLASSIC } + if replaceMode == "" { + replaceMode = REPLACE_MODE_RECREATE + } replaceMonitor := d.Get("replace_monitor_unhealthy").(bool) replaceLB := d.Get("replace_load_balancer_unhealthy").(bool) + desiredCapacitySyncWithMaxMinSize := d.Get("desired_capacity_sync_with_max_min_size").(bool) request.ServiceSettings = &as.ServiceSettings{ - ScalingMode: &scalingMode, - ReplaceMonitorUnhealthy: &replaceMonitor, - ReplaceLoadBalancerUnhealthy: &replaceLB, + ReplaceMonitorUnhealthy: &replaceMonitor, + ScalingMode: &scalingMode, + ReplaceLoadBalancerUnhealthy: &replaceLB, + ReplaceMode: &replaceMode, + DesiredCapacitySyncWithMaxMinSize: &desiredCapacitySyncWithMaxMinSize, } } diff --git a/tencentcloud/services/as/resource_tc_as_scaling_group.md b/tencentcloud/services/as/resource_tc_as_scaling_group.md index 5e54f30be3..6ab97417f8 100644 --- a/tencentcloud/services/as/resource_tc_as_scaling_group.md +++ b/tencentcloud/services/as/resource_tc_as_scaling_group.md @@ -78,17 +78,22 @@ resource "tencentcloud_clb_listener_rule" "example" { } resource "tencentcloud_as_scaling_group" "example" { - scaling_group_name = "tf-example" - configuration_id = tencentcloud_as_scaling_config.example.id - max_size = 1 - min_size = 0 - vpc_id = tencentcloud_vpc.vpc.id - subnet_ids = [tencentcloud_subnet.subnet.id] - project_id = 0 - default_cooldown = 400 - desired_capacity = 1 - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" + scaling_group_name = "tf-example" + configuration_id = tencentcloud_as_scaling_config.example.id + max_size = 1 + min_size = 0 + vpc_id = tencentcloud_vpc.vpc.id + subnet_ids = [tencentcloud_subnet.subnet.id] + project_id = 0 + default_cooldown = 400 + desired_capacity = 1 + replace_monitor_unhealthy = false + scaling_mode = "CLASSIC_SCALING" + replace_load_balancer_unhealthy = false + replace_mode = "RECREATE" + desired_capacity_sync_with_max_min_size = false + termination_policies = ["NEWEST_INSTANCE"] + retry_policy = "INCREMENTAL_INTERVALS" forward_balancer_ids { load_balancer_id = tencentcloud_clb_instance.example.id @@ -102,7 +107,7 @@ resource "tencentcloud_as_scaling_group" "example" { } tags = { - "createBy" = "tfExample" + createBy = "tfExample" } } ``` @@ -112,5 +117,5 @@ Import AutoScaling Groups can be imported using the id, e.g. ``` -$ terraform import tencentcloud_as_scaling_group.scaling_group asg-n32ymck2 +$ terraform import tencentcloud_as_scaling_group.example asg-n32ymck2 ``` \ No newline at end of file diff --git a/tencentcloud/services/as/service_tencentcloud_as.go b/tencentcloud/services/as/service_tencentcloud_as.go index 3c95a556fc..4a37f29a72 100644 --- a/tencentcloud/services/as/service_tencentcloud_as.go +++ b/tencentcloud/services/as/service_tencentcloud_as.go @@ -118,6 +118,9 @@ func (me *AsService) DescribeAutoScalingGroupById(ctx context.Context, scalingGr errRet = err return } + if response == nil || response.Response == nil || response.Response.AutoScalingGroupSet == nil { + return + } has = len(response.Response.AutoScalingGroupSet) if has < 1 { return diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419/models.go index fa2714d3b8..2a680c5e95 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419/models.go @@ -5865,8 +5865,13 @@ type ServiceSettings struct { // 注意:此字段可能返回 null,表示取不到有效值。 ReplaceMode *string `json:"ReplaceMode,omitnil,omitempty" name:"ReplaceMode"` - // 自动更新实例标签。默认取值为 false,配置后如伸缩组标签发生更新,会同步更新(同步更新仅支持新增、修改标签,暂不支持删除标签)伸缩组内运行中状态实例的标签,同步更新非立即生效,存在一定延迟。 + // 自动更新实例标签。默认取值为 False,配置后如伸缩组标签发生更新,会同步更新(同步更新仅支持新增、修改标签,暂不支持删除标签)伸缩组内运行中状态实例的标签,同步更新非立即生效,存在一定延迟。 AutoUpdateInstanceTags *bool `json:"AutoUpdateInstanceTags,omitnil,omitempty" name:"AutoUpdateInstanceTags"` + + // 期望实例数同步最大最小值。默认值为 False。该参数仅对修改伸缩组接口未传入期望数的场景生效。 + //
  • True: 修改最大值或最小值时,如与当前期望数存在冲突,则同步调整期望数。例如修改时传入最小值 2,当前期望数为 1,则同步调整期望数为 2。
  • + //
  • False: 修改最大值或最小值时,如与当前期望数存在冲突,报错提示不允许修改。
  • + DesiredCapacitySyncWithMaxMinSize *bool `json:"DesiredCapacitySyncWithMaxMinSize,omitnil,omitempty" name:"DesiredCapacitySyncWithMaxMinSize"` } // Predefined struct for user diff --git a/vendor/modules.txt b/vendor/modules.txt index 366b193f76..9fde8ba463 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1106,7 +1106,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway/v20180808 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.825 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm/v20210622 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1052 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.1071 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824 diff --git a/website/docs/r/as_scaling_group.html.markdown b/website/docs/r/as_scaling_group.html.markdown index 0bfa2ce878..03fc7ea428 100644 --- a/website/docs/r/as_scaling_group.html.markdown +++ b/website/docs/r/as_scaling_group.html.markdown @@ -89,17 +89,22 @@ resource "tencentcloud_clb_listener_rule" "example" { } resource "tencentcloud_as_scaling_group" "example" { - scaling_group_name = "tf-example" - configuration_id = tencentcloud_as_scaling_config.example.id - max_size = 1 - min_size = 0 - vpc_id = tencentcloud_vpc.vpc.id - subnet_ids = [tencentcloud_subnet.subnet.id] - project_id = 0 - default_cooldown = 400 - desired_capacity = 1 - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" + scaling_group_name = "tf-example" + configuration_id = tencentcloud_as_scaling_config.example.id + max_size = 1 + min_size = 0 + vpc_id = tencentcloud_vpc.vpc.id + subnet_ids = [tencentcloud_subnet.subnet.id] + project_id = 0 + default_cooldown = 400 + desired_capacity = 1 + replace_monitor_unhealthy = false + scaling_mode = "CLASSIC_SCALING" + replace_load_balancer_unhealthy = false + replace_mode = "RECREATE" + desired_capacity_sync_with_max_min_size = false + termination_policies = ["NEWEST_INSTANCE"] + retry_policy = "INCREMENTAL_INTERVALS" forward_balancer_ids { load_balancer_id = tencentcloud_clb_instance.example.id @@ -113,7 +118,7 @@ resource "tencentcloud_as_scaling_group" "example" { } tags = { - "createBy" = "tfExample" + createBy = "tfExample" } } ``` @@ -128,6 +133,7 @@ The following arguments are supported: * `scaling_group_name` - (Required, String) Name of a scaling group. * `vpc_id` - (Required, String) ID of VPC network. * `default_cooldown` - (Optional, Int) Default cooldown time in second, and default value is `300`. +* `desired_capacity_sync_with_max_min_size` - (Optional, Bool) The expected number of instances is synchronized with the maximum and minimum values. The default value is `False`. This parameter is effective only in the scenario where the expected number is not passed in when modifying the scaling group interface. True: When modifying the maximum or minimum value, if there is a conflict with the current expected number, the expected number is adjusted synchronously. For example, when modifying, if the minimum value 2 is passed in and the current expected number is 1, the expected number is adjusted synchronously to 2; False: When modifying the maximum or minimum value, if there is a conflict with the current expected number, an error message is displayed indicating that the modification is not allowed. * `desired_capacity` - (Optional, Int) Desired volume of CVM instances, which is between `max_size` and `min_size`. * `forward_balancer_ids` - (Optional, Set) List of application load balancers, which can't be specified with `load_balancer_ids` together. * `health_check_type` - (Optional, String) Health check type of instances in a scaling group.
  • CVM: confirm whether an instance is healthy based on the network status. If the pinged instance is unreachable, the instance will be considered unhealthy. For more information, see [Instance Health Check](https://intl.cloud.tencent.com/document/product/377/8553?from_cn_redirect=1)
  • CLB: confirm whether an instance is healthy based on the CLB health check status. For more information, see [Health Check Overview](https://intl.cloud.tencent.com/document/product/214/6097?from_cn_redirect=1).
    If the parameter is set to `CLB`, the scaling group will check both the network status and the CLB health check status. If the network check indicates unhealthy, the `HealthStatus` field will return `UNHEALTHY`. If the CLB health check indicates unhealthy, the `HealthStatus` field will return `CLB_UNHEALTHY`. If both checks indicate unhealthy, the `HealthStatus` field will return `UNHEALTHY|CLB_UNHEALTHY`. Default value: `CLB`. @@ -136,6 +142,7 @@ The following arguments are supported: * `multi_zone_subnet_policy` - (Optional, String) Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY. * `project_id` - (Optional, Int) Specifies to which project the scaling group belongs. * `replace_load_balancer_unhealthy` - (Optional, Bool) Enable unhealthy instance replacement. If set to `true`, AS will replace instances that are found unhealthy in the CLB health check. +* `replace_mode` - (Optional, String) Replace mode of unhealthy replacement service. Valid values: RECREATE: Rebuild an instance to replace the original unhealthy instance. RESET: Performing a system reinstallation on unhealthy instances to keep information such as data disks, private IP addresses, and instance IDs unchanged. The instance login settings, HostName, enhanced services, and UserData will remain consistent with the current launch configuration. Default value: RECREATE. Note: This field may return null, indicating that no valid values can be obtained. * `replace_monitor_unhealthy` - (Optional, Bool) Enables unhealthy instance replacement. If set to `true`, AS will replace instances that are flagged as unhealthy by Cloud Monitor. * `retry_policy` - (Optional, String) Available values for retry policies. Valid values: IMMEDIATE_RETRY and INCREMENTAL_INTERVALS. * `scaling_mode` - (Optional, String) Indicates scaling mode which creates and terminates instances (classic method), or method first tries to start stopped instances (wake up stopped) to perform scaling operations. Available values: `CLASSIC_SCALING`, `WAKE_UP_STOPPED_SCALING`. Default: `CLASSIC_SCALING`. @@ -171,6 +178,6 @@ In addition to all arguments above, the following attributes are exported: AutoScaling Groups can be imported using the id, e.g. ``` -$ terraform import tencentcloud_as_scaling_group.scaling_group asg-n32ymck2 +$ terraform import tencentcloud_as_scaling_group.example asg-n32ymck2 ```