Skip to content

Commit ca8a1c4

Browse files
authored
feat(as): [119299548]as group ignore the order of lb (#2984)
* as group ignore the order of lb * as group ignore the order of lb * add timeouts
1 parent 5a12b20 commit ca8a1c4

6 files changed

+25
-5
lines changed

.changelog/2984.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_as_scaling_group: The asg ignores the order of `forward_balancer_ids`
3+
```
4+
5+
```release-note:enhancement
6+
resource/tencentcloud_as_start_instance_refresh: Add `timeouts` for refresh action
7+
```

tencentcloud/services/as/resource_tc_as_scaling_group.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func ResourceTencentCloudAsScalingGroup() *schema.Resource {
9494
Description: "ID list of traditional load balancers.",
9595
},
9696
"forward_balancer_ids": {
97-
Type: schema.TypeList,
97+
Type: schema.TypeSet,
9898
Optional: true,
9999
ConflictsWith: []string{"load_balancer_ids"},
100100
Description: "List of application load balancers, which can't be specified with `load_balancer_ids` together.",
@@ -269,7 +269,7 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter
269269
}
270270

271271
if v, ok := d.GetOk("forward_balancer_ids"); ok {
272-
forwardBalancers := v.([]interface{})
272+
forwardBalancers := v.(*schema.Set).List()
273273
request.ForwardLoadBalancers = make([]*as.ForwardLoadBalancer, 0, len(forwardBalancers))
274274
for _, v := range forwardBalancers {
275275
vv := v.(map[string]interface{})
@@ -638,7 +638,7 @@ func resourceTencentCloudAsScalingGroupUpdate(d *schema.ResourceData, meta inter
638638
if d.HasChange("forward_balancer_ids") {
639639
updateAttrs = append(updateAttrs, "forward_balancer_ids")
640640

641-
forwardBalancers := d.Get("forward_balancer_ids").([]interface{})
641+
forwardBalancers := d.Get("forward_balancer_ids").(*schema.Set).List()
642642
balancerRequest.ForwardLoadBalancers = make([]*as.ForwardLoadBalancer, 0, len(forwardBalancers))
643643
for _, v := range forwardBalancers {
644644
vv := v.(map[string]interface{})

tencentcloud/services/as/resource_tc_as_start_instance_refresh.go

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tencentcloud/services/as/resource_tc_as_start_instance_refresh.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ resource "tencentcloud_as_start_instance_refresh" "example" {
1414
max_surge = 1
1515
}
1616
}
17+
18+
timeouts {
19+
create = "10m"
20+
}
1721
}
1822
```

website/docs/r/as_scaling_group.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The following arguments are supported:
129129
* `vpc_id` - (Required, String) ID of VPC network.
130130
* `default_cooldown` - (Optional, Int) Default cooldown time in second, and default value is `300`.
131131
* `desired_capacity` - (Optional, Int) Desired volume of CVM instances, which is between `max_size` and `min_size`.
132-
* `forward_balancer_ids` - (Optional, List) List of application load balancers, which can't be specified with `load_balancer_ids` together.
132+
* `forward_balancer_ids` - (Optional, Set) List of application load balancers, which can't be specified with `load_balancer_ids` together.
133133
* `health_check_type` - (Optional, String) Health check type of instances in a scaling group.<br><li>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)<br><li>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).<br>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`.
134134
* `lb_health_check_grace_period` - (Optional, Int) Grace period of the CLB health check during which the `IN_SERVICE` instances added will not be marked as `CLB_UNHEALTHY`.<br>Valid range: 0-7200, in seconds. Default value: `0`.
135135
* `load_balancer_ids` - (Optional, List: [`String`]) ID list of traditional load balancers.

website/docs/r/as_start_instance_refresh.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ resource "tencentcloud_as_start_instance_refresh" "example" {
2525
max_surge = 1
2626
}
2727
}
28+
29+
timeouts {
30+
create = "10m"
31+
}
2832
}
2933
```
3034

0 commit comments

Comments
 (0)