Skip to content

Commit c68a39a

Browse files
committed
add
1 parent b20aeb3 commit c68a39a

7 files changed

+16
-2
lines changed

tencentcloud/services/as/resource_tc_as_load_balancer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ func resourceTencentCloudAsLoadBalancerUpdate(d *schema.ResourceData, meta inter
270270
if v, ok := targetAttributesMap["port"]; ok {
271271
targetAttribute.Port = helper.IntUint64(v.(int))
272272
}
273+
273274
if v, ok := targetAttributesMap["weight"]; ok {
274275
targetAttribute.Weight = helper.IntUint64(v.(int))
275276
}
277+
276278
forwardLoadBalancer.TargetAttributes = append(forwardLoadBalancer.TargetAttributes, &targetAttribute)
277279
}
278280
}
@@ -296,6 +298,7 @@ func resourceTencentCloudAsLoadBalancerUpdate(d *schema.ResourceData, meta inter
296298
} else {
297299
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
298300
}
301+
299302
return nil
300303
})
301304

tencentcloud/services/as/resource_tc_as_load_balancer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Provides a resource to create a as load balancer
22

3+
~> **NOTE:** This resource must exclusive in one auto scaling group, do not declare additional rule resources of this auto scaling group elsewhere.
4+
5+
~> **NOTE:** If the `auto_scaling_group_id` field of this resource comes from the `tencentcloud_as_scaling_group` resource, then the `forward_balancer_ids` field of the `tencentcloud_as_scaling_group` resource cannot be set simultaneously with this resource, which may result in conflicts
6+
37
~> **NOTE:** `forward_load_balancers` List of application type load balancers, with a maximum of 100 bound application type load balancers for each scaling group.
48

59
Example Usage

tencentcloud/services/as/resource_tc_as_scaling_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ func resourceTencentCloudAsScalingConfigRead(d *schema.ResourceData, meta interf
630630

631631
if len(config.DisasterRecoverGroupIds) > 0 {
632632
_ = d.Set("disaster_recover_group_ids", helper.StringsInterfaces(config.DisasterRecoverGroupIds))
633+
} else {
634+
_ = d.Set("disaster_recover_group_ids", []string{})
633635
}
634636

635637
if config.DedicatedClusterId != nil {

tencentcloud/services/as/resource_tc_as_scaling_group.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func ResourceTencentCloudAsScalingGroup() *schema.Resource {
9696
"forward_balancer_ids": {
9797
Type: schema.TypeSet,
9898
Optional: true,
99+
Computed: true,
99100
ConflictsWith: []string{"load_balancer_ids"},
100101
Description: "List of application load balancers, which can't be specified with `load_balancer_ids` together.",
101102
Elem: &schema.Resource{

tencentcloud/services/as/resource_tc_as_scaling_group.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Provides a resource to create a group of AS (Auto scaling) instances.
22

3+
~> **NOTE:** If the resource management rule `forward_balancer_id` is used, resource `tencentcloud_as_load_balancer` management cannot be used simultaneously under the same auto scaling group id
4+
35
Example Usage
46

57
Create a basic Scaling Group

tencentcloud/services/as/service_tencentcloud_as.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ func (me *AsService) DescribeAsLoadBalancerById(ctx context.Context, autoScaling
762762
func (me *AsService) DeleteAsLoadBalancerById(ctx context.Context, autoScalingGroupId string) (errRet error) {
763763
logId := tccommon.GetLogId(ctx)
764764

765-
request := as.NewDetachLoadBalancersRequest()
765+
request := as.NewModifyLoadBalancersRequest()
766766
request.AutoScalingGroupId = &autoScalingGroupId
767767

768768
defer func() {
@@ -773,7 +773,7 @@ func (me *AsService) DeleteAsLoadBalancerById(ctx context.Context, autoScalingGr
773773

774774
ratelimit.Check(request.GetAction())
775775

776-
response, err := me.client.UseAsClient().DetachLoadBalancers(request)
776+
response, err := me.client.UseAsClient().ModifyLoadBalancers(request)
777777
if err != nil {
778778
errRet = err
779779
return

website/docs/r/as_scaling_group.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ description: |-
1111

1212
Provides a resource to create a group of AS (Auto scaling) instances.
1313

14+
~> **NOTE:** If the resource management rule `forward_balancer_id` is used, resource `tencentcloud_as_load_balancer` management cannot be used simultaneously under the same auto scaling group id
15+
1416
## Example Usage
1517

1618
### Create a basic Scaling Group

0 commit comments

Comments
 (0)