Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4bf6f7a

Browse files
authoredJun 12, 2024··
feat(clb): [117735262]support ipv6 param (#2675)
* feat(clb): ipv6 * feat(clb): ipv6 * feat(clb): ipv6 * feat(clb): ipv6
1 parent f73741d commit 4bf6f7a

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed
 

‎.changelog/2675.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_clb_instance: Support ipv6 return value `ipv6_mode` and `address_ipv6`
3+
```

‎tencentcloud/services/clb/resource_tc_clb_instance.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ func ResourceTencentCloudClbInstance() *schema.Resource {
216216
Computed: true,
217217
Description: "Domain name of the CLB instance.",
218218
},
219+
"ipv6_mode": {
220+
Type: schema.TypeString,
221+
Computed: true,
222+
Description: "This field is meaningful when the IP address version is ipv6, `IPv6Nat64` | `IPv6FullChain`.",
223+
},
224+
"address_ipv6": {
225+
Type: schema.TypeString,
226+
Computed: true,
227+
Description: "The IPv6 address of the load balancing instance.",
228+
},
219229
},
220230
}
221231
}
@@ -575,6 +585,8 @@ func resourceTencentCloudClbInstanceRead(d *schema.ResourceData, meta interface{
575585
_ = d.Set("project_id", instance.ProjectId)
576586
_ = d.Set("security_groups", helper.StringsInterfaces(instance.SecureGroups))
577587
_ = d.Set("domain", instance.LoadBalancerDomain)
588+
_ = d.Set("ipv6_mode", instance.IPv6Mode)
589+
_ = d.Set("address_ipv6", instance.AddressIPv6)
578590

579591
if instance.SlaType != nil {
580592
_ = d.Set("sla_type", instance.SlaType)

‎tencentcloud/services/clb/resource_tc_clb_instance_test.go

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,6 @@ resource "tencentcloud_clb_instance" "clb_internal" {
424424
`
425425

426426
const testAccClbInstance_open = `
427-
resource "tencentcloud_security_group" "foo" {
428-
name = "keep-ci-temp-test-sg"
429-
}
430-
431427
resource "tencentcloud_vpc" "foo" {
432428
name = "clb-instance-open-vpc"
433429
cidr_block = "10.0.0.0/16"
@@ -440,7 +436,7 @@ resource "tencentcloud_clb_instance" "clb_open" {
440436
vpc_id = tencentcloud_vpc.foo.id
441437
target_region_info_region = "ap-guangzhou"
442438
target_region_info_vpc_id = tencentcloud_vpc.foo.id
443-
security_groups = [tencentcloud_security_group.foo.id]
439+
security_groups = ["sg-if748odn"]
444440
445441
tags = {
446442
test = "tf"
@@ -509,9 +505,6 @@ resource "tencentcloud_clb_instance" "clb_internal" {
509505
}
510506
`
511507
const testAccClbInstance_update_open = `
512-
resource "tencentcloud_security_group" "foo" {
513-
name = "clb-instance-sg"
514-
}
515508
516509
resource "tencentcloud_vpc" "foo" {
517510
name = "clb-instance-open-vpc"
@@ -525,7 +518,7 @@ resource "tencentcloud_clb_instance" "clb_open" {
525518
project_id = 0
526519
target_region_info_region = "ap-guangzhou"
527520
target_region_info_vpc_id = tencentcloud_vpc.foo.id
528-
security_groups = [tencentcloud_security_group.foo.id]
521+
security_groups = ["sg-if748odn"]
529522
530523
tags = {
531524
test = "test"
@@ -546,12 +539,6 @@ resource "tencentcloud_subnet" "subnet" {
546539
is_multicast = false
547540
}
548541
549-
resource "tencentcloud_security_group" "sglab" {
550-
name = "clb-instance-enable-sg"
551-
description = "favourite sg"
552-
project_id = 0
553-
}
554-
555542
resource "tencentcloud_vpc" "foo" {
556543
name = "clb-instance-default-vpc"
557544
cidr_block = "10.0.0.0/16"
@@ -568,7 +555,7 @@ resource "tencentcloud_clb_instance" "default_enable" {
568555
vpc_id = tencentcloud_vpc.foo.id
569556
load_balancer_pass_to_target = true
570557
571-
security_groups = [tencentcloud_security_group.sglab.id]
558+
security_groups = ["sg-if748odn"]
572559
target_region_info_region = "ap-guangzhou"
573560
target_region_info_vpc_id = tencentcloud_vpc.foo.id
574561
@@ -591,12 +578,6 @@ resource "tencentcloud_subnet" "subnet" {
591578
is_multicast = false
592579
}
593580
594-
resource "tencentcloud_security_group" "sglab" {
595-
name = "clb-instance-enable-sg"
596-
description = "favourite sg"
597-
project_id = 0
598-
}
599-
600581
resource "tencentcloud_vpc" "foo" {
601582
name = "clb-instance-default-vpc"
602583
cidr_block = "10.0.0.0/16"
@@ -613,7 +594,7 @@ resource "tencentcloud_clb_instance" "default_enable" {
613594
vpc_id = tencentcloud_vpc.foo.id
614595
load_balancer_pass_to_target = true
615596
616-
security_groups = [tencentcloud_security_group.sglab.id]
597+
security_groups = ["sg-if748odn"]
617598
target_region_info_region = "ap-guangzhou"
618599
target_region_info_vpc_id = tencentcloud_vpc.foo.id
619600

‎website/docs/r/clb_instance.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ The `snat_ips` object supports the following:
314314
In addition to all arguments above, the following attributes are exported:
315315

316316
* `id` - ID of the resource.
317+
* `address_ipv6` - The IPv6 address of the load balancing instance.
317318
* `clb_vips` - The virtual service address table of the CLB.
318319
* `domain` - Domain name of the CLB instance.
320+
* `ipv6_mode` - This field is meaningful when the IP address version is ipv6, `IPv6Nat64` | `IPv6FullChain`.
319321

320322

321323
## Import

0 commit comments

Comments
 (0)
Please sign in to comment.