Skip to content

Commit

Permalink
feat(as): [119299548]as group ignore the order of lb (#2984)
Browse files Browse the repository at this point in the history
* as group ignore the order of lb

* as group ignore the order of lb

* add timeouts
  • Loading branch information
hellertang authored Dec 1, 2024
1 parent 5a12b20 commit ca8a1c4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changelog/2984.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/tencentcloud_as_scaling_group: The asg ignores the order of `forward_balancer_ids`
```

```release-note:enhancement
resource/tencentcloud_as_start_instance_refresh: Add `timeouts` for refresh action
```
6 changes: 3 additions & 3 deletions tencentcloud/services/as/resource_tc_as_scaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func ResourceTencentCloudAsScalingGroup() *schema.Resource {
Description: "ID list of traditional load balancers.",
},
"forward_balancer_ids": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
ConflictsWith: []string{"load_balancer_ids"},
Description: "List of application load balancers, which can't be specified with `load_balancer_ids` together.",
Expand Down Expand Up @@ -269,7 +269,7 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter
}

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

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ resource "tencentcloud_as_start_instance_refresh" "example" {
max_surge = 1
}
}
timeouts {
create = "10m"
}
}
```
2 changes: 1 addition & 1 deletion website/docs/r/as_scaling_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The following arguments are supported:
* `vpc_id` - (Required, String) ID of VPC network.
* `default_cooldown` - (Optional, Int) Default cooldown time in second, and default value is `300`.
* `desired_capacity` - (Optional, Int) Desired volume of CVM instances, which is between `max_size` and `min_size`.
* `forward_balancer_ids` - (Optional, List) List of application load balancers, which can't be specified with `load_balancer_ids` together.
* `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.<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`.
* `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`.
* `load_balancer_ids` - (Optional, List: [`String`]) ID list of traditional load balancers.
Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/as_start_instance_refresh.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ resource "tencentcloud_as_start_instance_refresh" "example" {
max_surge = 1
}
}
timeouts {
create = "10m"
}
}
```

Expand Down

0 comments on commit ca8a1c4

Please sign in to comment.