Skip to content

Commit d2a930b

Browse files
SevenEarthWeiMengXSbruceybiantongyimingmikatong
authored
fix/tdmq_rabbitmq (#2510)
* fix/tdmq_rabbitmq * fix/tdmq_rabbitmq * feat: add para (#2512) * feat: add para * feat: add para * resource scanning added to obtain creator code (#2519) * resource scanning added to obtain creator code * add get resource creator account info code * add resource create action * update query rule * update create time parse code * fix lighthouse import (#2508) * fix lighthouse import * import set default * update * fix update && fix unittest * add changelog --------- Co-authored-by: mikatong <[email protected]> * add --------- Co-authored-by: Wmxs <[email protected]> Co-authored-by: bruceybian <[email protected]> Co-authored-by: tongyiming <[email protected]> Co-authored-by: mikatong <[email protected]>
1 parent 1b6eae3 commit d2a930b

File tree

6 files changed

+33
-4
lines changed

6 files changed

+33
-4
lines changed

.changelog/2510.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_tdmq_rabbitmq_vip_instance: Adapt to imported resources
3+
```
4+

tencentcloud/common/cloud_common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package common
22

33
import (
44
"encoding/json"
5-
cls "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016"
65
"log"
76
"strconv"
87
"strings"
98
"time"
109

10+
cls "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016"
11+
1112
cam "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116"
1213
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity"
1314
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"

tencentcloud/services/trabbit/resource_tc_tdmq_rabbitmq_vip_instance.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ func ResourceTencentCloudTdmqRabbitmqVipInstance() *schema.Resource {
2121
Read: resourceTencentCloudTdmqRabbitmqVipInstanceRead,
2222
Update: resourceTencentCloudTdmqRabbitmqVipInstanceUpdate,
2323
Delete: resourceTencentCloudTdmqRabbitmqVipInstanceDelete,
24-
24+
Importer: &schema.ResourceImporter{
25+
State: schema.ImportStatePassthrough,
26+
},
2527
Schema: map[string]*schema.Schema{
2628
"zone_ids": {
2729
Required: true,

tencentcloud/services/trabbit/resource_tc_tdmq_rabbitmq_vip_instance.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,13 @@ resource "tencentcloud_tdmq_rabbitmq_vip_instance" "example" {
3030
auto_renew_flag = true
3131
time_span = 1
3232
}
33-
```
33+
```
34+
35+
Import
36+
37+
tdmq rabbitmq_vip_instance can be imported using the id, e.g.
38+
39+
```
40+
terraform import tencentcloud_tdmq_rabbitmq_vip_instance.example amqp-mok52gmn
41+
```
42+

tencentcloud/services/trabbit/resource_tc_tdmq_rabbitmq_vip_instance_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestAccTencentCloudTdmqRabbitmqVipInstanceResource_basic(t *testing.T) {
1919
t.Parallel()
2020
resource.Test(t, resource.TestCase{
2121
PreCheck: func() {
22-
tcacctest.AccPreCheckCommon(t, tcacctest.ACCOUNT_TYPE_PREPAY)
22+
tcacctest.AccPreCheck(t)
2323
},
2424
CheckDestroy: testAccCheckTdmqRabbitmqVipInstanceDestroy,
2525
Providers: tcacctest.AccProviders,
@@ -31,6 +31,11 @@ func TestAccTencentCloudTdmqRabbitmqVipInstanceResource_basic(t *testing.T) {
3131
resource.TestCheckResourceAttrSet("tencentcloud_tdmq_rabbitmq_vip_instance.example", "id"),
3232
),
3333
},
34+
{
35+
ResourceName: "tencentcloud_tdmq_rabbitmq_vip_instance.template",
36+
ImportState: true,
37+
ImportStateVerify: true,
38+
},
3439
{
3540
Config: testAccTdmqRabbitmqVipInstanceUpdate,
3641
Check: resource.ComposeTestCheckFunc(

website/docs/r/tdmq_rabbitmq_vip_instance.html.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,11 @@ In addition to all arguments above, the following attributes are exported:
6666

6767

6868

69+
## Import
70+
71+
tdmq rabbitmq_vip_instance can be imported using the id, e.g.
72+
73+
```
74+
terraform import tencentcloud_tdmq_rabbitmq_vip_instance.example amqp-mok52gmn
75+
```
76+

0 commit comments

Comments
 (0)