Skip to content

Commit d299899

Browse files
gitmknanonymous
andauthored
fix: modify doc (#1976)
* fix: modify doc * feat: add changelog --------- Co-authored-by: anonymous <anonymous@mail.org>
1 parent 92b821c commit d299899

File tree

5 files changed

+30
-13
lines changed

5 files changed

+30
-13
lines changed

.changelog/1976.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_monitor_grafana_instance: Deprecated `is_distroy`, use `is_destroy` instead of `is_distroy`
3+
```

tencentcloud/resource_tc_as_scaling_group.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,10 @@ func resourceTencentCloudAsScalingGroupRead(d *schema.ResourceData, meta interfa
482482
targetAttributes = append(targetAttributes, targetAttribute)
483483
}
484484
forwardLoadBalancer := map[string]interface{}{
485-
"load_balancer_id": *v.LoadBalancerId,
486-
"listener_id": *v.ListenerId,
487-
"target_attributes": targetAttributes,
488-
"rule_id": *v.LocationId,
485+
"load_balancer_id": *v.LoadBalancerId,
486+
"listener_id": *v.ListenerId,
487+
"target_attribute": targetAttributes,
488+
"rule_id": *v.LocationId,
489489
}
490490
forwardLoadBalancers = append(forwardLoadBalancers, forwardLoadBalancer)
491491
}

tencentcloud/resource_tc_monitor_grafana_instance.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "tencentcloud_monitor_grafana_instance" "foo" {
2626
subnet_ids = [tencentcloud_subnet.subnet.id]
2727
grafana_init_password = "1234567890"
2828
enable_internet = false
29-
is_distroy = true
29+
is_destroy = true
3030
3131
tags = {
3232
"createdBy" = "test"
@@ -114,6 +114,13 @@ func resourceTencentCloudMonitorGrafanaInstance() *schema.Resource {
114114
},
115115

116116
"is_distroy": {
117+
Type: schema.TypeBool,
118+
Optional: true,
119+
Deprecated: "It has been deprecated from version 1.81.16.",
120+
Description: "Whether to clean up completely, the default is false.",
121+
},
122+
123+
"is_destroy": {
117124
Type: schema.TypeBool,
118125
Optional: true,
119126
Description: "Whether to clean up completely, the default is false.",
@@ -404,12 +411,19 @@ func resourceTencentCloudMonitorGrafanaInstanceDelete(d *schema.ResourceData, me
404411
return err
405412
}
406413

414+
claenFlag := false
407415
if v, ok := d.GetOk("is_distroy"); ok && v.(bool) {
416+
claenFlag = true
417+
}
418+
if v, ok := d.GetOk("is_destroy"); ok && v.(bool) {
419+
claenFlag = true
420+
}
421+
if claenFlag {
408422
if err := service.CleanGrafanaInstanceById(ctx, instanceId); err != nil {
409423
return err
410424
}
411425

412-
err = resource.Retry(1*readRetryTimeout, func() *resource.RetryError {
426+
err = resource.Retry(readRetryTimeout, func() *resource.RetryError {
413427
instance, errRet := service.DescribeMonitorGrafanaInstance(ctx, instanceId)
414428
if errRet != nil {
415429
return retryError(errRet, InternalError)

tencentcloud/resource_tc_monitor_grafana_instance_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
9-
108
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
9+
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1110
)
1211

1312
// go test -i; go test -test.run TestAccTencentCloudMonitorGrafanaInstance_basic -v
@@ -44,7 +43,7 @@ func TestAccTencentCloudMonitorGrafanaInstance_basic(t *testing.T) {
4443
ResourceName: "tencentcloud_monitor_grafana_instance.grafanaInstance",
4544
ImportState: true,
4645
ImportStateVerify: true,
47-
ImportStateVerifyIgnore: []string{"grafana_init_password"},
46+
ImportStateVerifyIgnore: []string{"grafana_init_password", "is_destroy"},
4847
},
4948
},
5049
})
@@ -124,7 +123,7 @@ resource "tencentcloud_monitor_grafana_instance" "grafanaInstance" {
124123
subnet_ids = [var.subnet_id]
125124
grafana_init_password = "1234567890"
126125
enable_internet = false
127-
is_distroy = true
126+
is_destroy = true
128127
129128
tags = {
130129
"createdBy" = "test"
@@ -139,7 +138,7 @@ resource "tencentcloud_monitor_grafana_instance" "grafanaInstance" {
139138
subnet_ids = [var.subnet_id]
140139
grafana_init_password = "1234567890"
141140
enable_internet = false
142-
is_distroy = true
141+
is_destroy = true
143142
144143
tags = {
145144
"createdBy" = "test"

website/docs/r/monitor_grafana_instance.html.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ resource "tencentcloud_monitor_grafana_instance" "foo" {
3636
subnet_ids = [tencentcloud_subnet.subnet.id]
3737
grafana_init_password = "1234567890"
3838
enable_internet = false
39-
is_distroy = true
39+
is_destroy = true
4040
4141
tags = {
4242
"createdBy" = "test"
@@ -51,7 +51,8 @@ The following arguments are supported:
5151
* `instance_name` - (Required, String) Instance name.
5252
* `enable_internet` - (Optional, Bool) Control whether grafana could be accessed by internet.
5353
* `grafana_init_password` - (Optional, String) Grafana server admin password.
54-
* `is_distroy` - (Optional, Bool) Whether to clean up completely, the default is false.
54+
* `is_destroy` - (Optional, Bool) Whether to clean up completely, the default is false.
55+
* `is_distroy` - (Optional, Bool, **Deprecated**) It has been deprecated from version 1.81.16. Whether to clean up completely, the default is false.
5556
* `subnet_ids` - (Optional, Set: [`String`]) Subnet Id array.
5657
* `tags` - (Optional, Map) Tag description list.
5758
* `vpc_id` - (Optional, String) Vpc Id.

0 commit comments

Comments
 (0)