Skip to content

Commit 05865ba

Browse files
tongyimingmikatong
andauthored
fix(cvm): [123456789] support ipv6_addresses and public_ipv6_addresses (#3528)
* support ipv6_addresses and public_ipv6_addresses * add changelog --------- Co-authored-by: mikatong <mikatong@tencent.com>
1 parent d12fd6c commit 05865ba

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

.changelog/3528.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_instance: support ipv6_addresses and public_ipv6_addresses
3+
```

tencentcloud/services/cvm/resource_tc_instance.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,18 @@ func ResourceTencentCloudInstance() *schema.Resource {
539539
Computed: true,
540540
Description: "Instance os name.",
541541
},
542+
"ipv6_addresses": {
543+
Type: schema.TypeList,
544+
Elem: &schema.Schema{Type: schema.TypeString},
545+
Computed: true,
546+
Description: "IPv6 address of the instance.",
547+
},
548+
"public_ipv6_addresses": {
549+
Type: schema.TypeList,
550+
Elem: &schema.Schema{Type: schema.TypeString},
551+
Computed: true,
552+
Description: "The public IPv6 address to which the instance is bound.",
553+
},
542554
},
543555

544556
CustomizeDiff: customdiff.All(
@@ -1198,6 +1210,8 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
11981210
_ = d.Set("memory", instance.Memory)
11991211
_ = d.Set("os_name", instance.OsName)
12001212
_ = d.Set("hpc_cluster_id", instance.HpcClusterId)
1213+
_ = d.Set("ipv6_addresses", instance.IPv6Addresses)
1214+
_ = d.Set("public_ipv6_addresses", instance.PublicIPv6Addresses)
12011215

12021216
if instance.Uuid != nil {
12031217
_ = d.Set("uuid", instance.Uuid)

tencentcloud/services/cvm/resource_tc_instance_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,7 @@ func TestAccTencentCloudNeedFixCvmInstanceResource_ReleaseAddress(t *testing.T)
30583058
resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_address_type", "HighQualityEIPv6"),
30593059
resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_address_count", "1"),
30603060
resource.TestCheckResourceAttr("tencentcloud_instance.foo", "release_address", "true"),
3061+
resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_addresses.#", "1"),
30613062
),
30623063
},
30633064
},

website/docs/r/instance.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,11 @@ In addition to all arguments above, the following attributes are exported:
372372
* `create_time` - Create time of the instance.
373373
* `expired_time` - Expired time of the instance.
374374
* `instance_status` - Current status of the instance.
375+
* `ipv6_addresses` - IPv6 address of the instance.
375376
* `memory` - Instance memory capacity, unit in GB.
376377
* `os_name` - Instance os name.
377378
* `public_ip` - Public IP of the instance.
379+
* `public_ipv6_addresses` - The public IPv6 address to which the instance is bound.
378380
* `uuid` - Globally unique ID of the instance.
379381

380382

0 commit comments

Comments
 (0)