Skip to content

Commit c93284b

Browse files
authored
feat(ccn): [120069939] add ipv6s (#2898)
* support ipv6s * support ipv6s
1 parent ea2fac3 commit c93284b

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.changelog/2898.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
datasource/tencentcloud_enis: add `ipv6s`
3+
```

tencentcloud/services/vpc/data_source_tc_enis.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,40 @@ func DataSourceTencentCloudEnis() *schema.Resource {
155155
},
156156
},
157157
},
158+
"ipv6s": {
159+
Type: schema.TypeList,
160+
Computed: true,
161+
Description: "A set of intranet IPv6s.",
162+
Elem: &schema.Resource{
163+
Schema: map[string]*schema.Schema{
164+
"address": {
165+
Type: schema.TypeString,
166+
Computed: true,
167+
Description: "`IPv6` address, such as `3402:4e00:20:100:0:8cd9:2a67:71f3`.",
168+
},
169+
"primary": {
170+
Type: schema.TypeBool,
171+
Computed: true,
172+
Description: "Whether it is a primary `IP`.",
173+
},
174+
"address_id": {
175+
Type: schema.TypeString,
176+
Computed: true,
177+
Description: "The `ID` of the `EIP` instance, such as `eip-hxlqja90`.",
178+
},
179+
"description": {
180+
Type: schema.TypeString,
181+
Computed: true,
182+
Description: "Message description.",
183+
},
184+
"is_wan_ip_blocked": {
185+
Type: schema.TypeBool,
186+
Computed: true,
187+
Description: "Whether the public IP is blocked.",
188+
},
189+
},
190+
},
191+
},
158192
"instance_id": {
159193
Type: schema.TypeString,
160194
Computed: true,
@@ -255,6 +289,18 @@ func dataSourceTencentCloudEnisRead(d *schema.ResourceData, m interface{}) error
255289
})
256290
}
257291

292+
ipv6s := make([]map[string]interface{}, 0, len(eni.Ipv6AddressSet))
293+
294+
for _, ipv6 := range eni.Ipv6AddressSet {
295+
ipv6s = append(ipv6s, map[string]interface{}{
296+
"address": ipv6.Address,
297+
"primary": ipv6.Primary,
298+
"address_id": ipv6.AddressId,
299+
"description": ipv6.Description,
300+
"is_wan_ip_blocked": ipv6.IsWanIpBlocked,
301+
})
302+
}
303+
258304
sgs := make([]string, 0, len(eni.GroupSet))
259305
for _, sg := range eni.GroupSet {
260306
sgs = append(sgs, *sg)
@@ -278,6 +324,7 @@ func dataSourceTencentCloudEnisRead(d *schema.ResourceData, m interface{}) error
278324
"state": eni.State,
279325
"create_time": eni.CreatedTime,
280326
"ipv4s": ipv4s,
327+
"ipv6s": ipv6s,
281328
"security_groups": sgs,
282329
"tags": respTags,
283330
"cdc_id": eni.CdcId,

website/docs/d/enis.html.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ In addition to all arguments above, the following attributes are exported:
4848
* `description` - Description of the IP.
4949
* `ip` - Intranet IP.
5050
* `primary` - Indicates whether the IP is primary.
51+
* `ipv6s` - A set of intranet IPv6s.
52+
* `address_id` - The `ID` of the `EIP` instance, such as `eip-hxlqja90`.
53+
* `address` - `IPv6` address, such as `3402:4e00:20:100:0:8cd9:2a67:71f3`.
54+
* `description` - Message description.
55+
* `is_wan_ip_blocked` - Whether the public IP is blocked.
56+
* `primary` - Whether it is a primary `IP`.
5157
* `mac` - MAC address.
5258
* `name` - Name of the ENI.
5359
* `primary` - Indicates whether the IP is primary.

0 commit comments

Comments
 (0)