Skip to content

Commit dd04712

Browse files
tongyimingmikatong
andauthored
Feat/lighthouse import (#2443)
* support lighthouse import * update doc * add changelog --------- Co-authored-by: mikatong <mikatong@tencent.com>
1 parent dbe0785 commit dd04712

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

.changelog/2443.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_lighthouse_instance: support import
3+
```

tencentcloud/services/lighthouse/resource_tc_lighthouse_instance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ func ResourceTencentCloudLighthouseInstance() *schema.Resource {
2222
Read: resourceTencentCloudLighthouseInstanceRead,
2323
Delete: resourceTencentCloudLighthouseInstanceDelete,
2424
Update: resourceTencentCloudLighthouseInstanceUpdate,
25+
Importer: &schema.ResourceImporter{
26+
State: schema.ImportStatePassthrough,
27+
},
2528
Schema: map[string]*schema.Schema{
2629
"bundle_id": {
2730
Type: schema.TypeString,

tencentcloud/services/lighthouse/resource_tc_lighthouse_instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,12 @@ resource "tencentcloud_lighthouse_instance" "lighthouse" {
7373
}
7474
firewall_template_id = tencentcloud_lighthouse_firewall_template.firewall_template.id
7575
}
76+
```
77+
78+
Import
79+
80+
lighthouse instance can be imported using the id, e.g.
81+
82+
```
83+
terraform import tencentcloud_lighthouse_instance.lighthouse lhins-xxxxxx
7684
```

tencentcloud/services/lighthouse/resource_tc_lighthouse_instance_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ func TestAccTencentCloudLighthouseInstanceResource_basic(t *testing.T) {
6868
resource.TestCheckResourceAttr("tencentcloud_lighthouse_instance.instance", "renew_flag", "NOTIFY_AND_MANUAL_RENEW"),
6969
),
7070
},
71+
{
72+
ResourceName: "tencentcloud_lighthouse_instance.instance",
73+
ImportState: true,
74+
ImportStateVerify: true,
75+
ImportStateVerifyIgnore: []string{"is_update_bundle_id_auto_voucher", "period", "dry_run", "client_token", "login_configuration", "permit_default_key_pair_login", "isolate_data_disk", "containers", "firewall_template_id"},
76+
},
7177
},
7278
})
7379
}

website/docs/r/lighthouse_instance.html.markdown

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

145145

146146

147+
## Import
148+
149+
lighthouse instance can be imported using the id, e.g.
150+
151+
```
152+
terraform import tencentcloud_lighthouse_instance.lighthouse lhins-xxxxxx
153+
```
154+

0 commit comments

Comments
 (0)