diff --git a/.changelog/3528.txt b/.changelog/3528.txt new file mode 100644 index 0000000000..128808a15b --- /dev/null +++ b/.changelog/3528.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_instance: support ipv6_addresses and public_ipv6_addresses +``` diff --git a/tencentcloud/services/cvm/resource_tc_instance.go b/tencentcloud/services/cvm/resource_tc_instance.go index 714538765a..321b52fe2c 100644 --- a/tencentcloud/services/cvm/resource_tc_instance.go +++ b/tencentcloud/services/cvm/resource_tc_instance.go @@ -539,6 +539,18 @@ func ResourceTencentCloudInstance() *schema.Resource { Computed: true, Description: "Instance os name.", }, + "ipv6_addresses": { + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + Description: "IPv6 address of the instance.", + }, + "public_ipv6_addresses": { + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + Description: "The public IPv6 address to which the instance is bound.", + }, }, CustomizeDiff: customdiff.All( @@ -1198,6 +1210,8 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{}) _ = d.Set("memory", instance.Memory) _ = d.Set("os_name", instance.OsName) _ = d.Set("hpc_cluster_id", instance.HpcClusterId) + _ = d.Set("ipv6_addresses", instance.IPv6Addresses) + _ = d.Set("public_ipv6_addresses", instance.PublicIPv6Addresses) if instance.Uuid != nil { _ = d.Set("uuid", instance.Uuid) diff --git a/tencentcloud/services/cvm/resource_tc_instance_test.go b/tencentcloud/services/cvm/resource_tc_instance_test.go index c4fe800097..134fb69a58 100644 --- a/tencentcloud/services/cvm/resource_tc_instance_test.go +++ b/tencentcloud/services/cvm/resource_tc_instance_test.go @@ -3058,6 +3058,7 @@ func TestAccTencentCloudNeedFixCvmInstanceResource_ReleaseAddress(t *testing.T) resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_address_type", "HighQualityEIPv6"), resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_address_count", "1"), resource.TestCheckResourceAttr("tencentcloud_instance.foo", "release_address", "true"), + resource.TestCheckResourceAttr("tencentcloud_instance.foo", "ipv6_addresses.#", "1"), ), }, }, diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index 2ba1d6b36b..618f316d83 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -372,9 +372,11 @@ In addition to all arguments above, the following attributes are exported: * `create_time` - Create time of the instance. * `expired_time` - Expired time of the instance. * `instance_status` - Current status of the instance. +* `ipv6_addresses` - IPv6 address of the instance. * `memory` - Instance memory capacity, unit in GB. * `os_name` - Instance os name. * `public_ip` - Public IP of the instance. +* `public_ipv6_addresses` - The public IPv6 address to which the instance is bound. * `uuid` - Globally unique ID of the instance.