Skip to content

Commit 7bc83a9

Browse files
committed
add nat ipv6 exclusion
1 parent 56a1650 commit 7bc83a9

File tree

7 files changed

+46
-36
lines changed

7 files changed

+46
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 0.6.3 (unreleased)
22

3-
- Fix issue, where NAT is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
3+
- Fix issue, where NAT IPv4 and IPv6 is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
44
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
55

66
## 0.6.2

docs/guides/changelog.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
---
2-
subcategory: "Guides"
3-
page_title: "Changelog"
4-
description: |-
5-
Changelog
6-
---
7-
8-
# Changelog
9-
1+
---
2+
subcategory: "Guides"
3+
page_title: "Changelog"
4+
description: |-
5+
Changelog
6+
---
7+
8+
# Changelog
9+
1010
## 0.6.3 (unreleased)
1111

12-
- Fix issue, where NAT is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
12+
- Fix issue, where NAT IPv4 and IPv6 is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
1313
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
1414

15-
1615
## 0.6.2
1716

1817
- Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417)
@@ -453,4 +452,4 @@ description: |-
453452
## 0.1.0 (July 23, 2021)
454453

455454
- Initial Release
456-
455+

docs/resources/transport_wan_vpn_interface_ethernet_feature.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
228228
- `media_type` (String) Media type
229229
- Choices: `auto-select`, `rj45`, `sfp`
230230
- `media_type_variable` (String) Variable name
231-
- `nat64` (Boolean) NAT64 on this interface
231+
- `nat64` (Boolean) NAT64 on this interface, Attribute conditional on `nat_ipv6` being equal to `true`
232232
- Default value: `false`
233-
- `nat66` (Boolean) NAT66 on this interface
233+
- `nat66` (Boolean) NAT66 on this interface, Attribute conditional on `nat_ipv6` being equal to `true`
234234
- Default value: `false`
235235
- `nat_ipv4` (Boolean) enable Network Address Translation on this interface
236236
- Default value: `false`
@@ -261,8 +261,8 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
261261
- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes, Attribute conditional on `nat_ipv4` being equal to `true`
262262
- Range: `1`-`8947`
263263
- Default value: `1`
264-
- `nat_udp_timeout_variable` (String) Variable name
265-
- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
264+
- `nat_udp_timeout_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
265+
- `new_static_nats` (Attributes List) static NAT, Attribute conditional on `nat_ipv4` being equal to `true` (see [below for nested schema](#nestedatt--new_static_nats))
266266
- `per_tunnel_qos` (Boolean) Per-tunnel Qos, Attribute conditional on `tunnel_interface` being equal to `true`
267267
- Default value: `false`
268268
- `per_tunnel_qos_variable` (String) Variable name, Attribute conditional on `tunnel_interface` being equal to `true`
@@ -304,7 +304,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
304304
- `speed` (String) Set interface speed
305305
- Choices: `10`, `100`, `1000`, `2500`, `10000`
306306
- `speed_variable` (String) Variable name
307-
- `static_nat66` (Attributes List) static NAT66 (see [below for nested schema](#nestedatt--static_nat66))
307+
- `static_nat66` (Attributes List) static NAT66, Attribute conditional on `nat_ipv6` being equal to `true` (see [below for nested schema](#nestedatt--static_nat66))
308308
- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
309309
- Range: `500`-`1460`
310310
- `tcp_mss_variable` (String) Variable name

gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,25 @@ attributes:
532532
data_path: [natAttributesIpv6]
533533
exclude_null: true
534534
example: false
535+
conditional_attribute:
536+
name: nat_ipv6
537+
value: true
538+
type: Bool
535539
- model_name: nat66
536540
data_path: [natAttributesIpv6]
537541
exclude_null: true
538542
example: true
543+
conditional_attribute:
544+
name: nat_ipv6
545+
value: true
546+
type: Bool
539547
- model_name: staticNat66
540548
data_path: [natAttributesIpv6]
541549
exclude_null: true
550+
conditional_attribute:
551+
name: nat_ipv6
552+
value: true
553+
type: Bool
542554
attributes:
543555
- model_name: sourcePrefix
544556
id: true

internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,18 +1478,18 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string
14781478
}
14791479
}
14801480
if !data.Nat64.IsNull() {
1481-
if true {
1481+
if true && data.NatIpv6.ValueBool() == true {
14821482
body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global")
14831483
body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool())
14841484
}
14851485
}
14861486
if !data.Nat66.IsNull() {
1487-
if true {
1487+
if true && data.NatIpv6.ValueBool() == true {
14881488
body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global")
14891489
body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool())
14901490
}
14911491
}
1492-
if true {
1492+
if true && data.NatIpv6.ValueBool() == true {
14931493

14941494
for _, item := range data.StaticNat66 {
14951495
itemBody := ""

internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,15 +818,15 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte
818818
Optional: true,
819819
},
820820
"nat64": schema.BoolAttribute{
821-
MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface").AddDefaultValueDescription("false").String,
821+
MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface, Attribute conditional on `nat_ipv6` being equal to `true`").AddDefaultValueDescription("false").String,
822822
Optional: true,
823823
},
824824
"nat66": schema.BoolAttribute{
825-
MarkdownDescription: helpers.NewAttributeDescription("NAT66 on this interface").AddDefaultValueDescription("false").String,
825+
MarkdownDescription: helpers.NewAttributeDescription("NAT66 on this interface, Attribute conditional on `nat_ipv6` being equal to `true`").AddDefaultValueDescription("false").String,
826826
Optional: true,
827827
},
828828
"static_nat66": schema.ListNestedAttribute{
829-
MarkdownDescription: helpers.NewAttributeDescription("static NAT66").String,
829+
MarkdownDescription: helpers.NewAttributeDescription("static NAT66, Attribute conditional on `nat_ipv6` being equal to `true`").String,
830830
Optional: true,
831831
NestedObject: schema.NestedAttributeObject{
832832
Attributes: map[string]schema.Attribute{

templates/guides/changelog.md.tmpl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
---
2-
subcategory: "Guides"
3-
page_title: "Changelog"
4-
description: |-
5-
Changelog
6-
---
7-
8-
# Changelog
9-
1+
---
2+
subcategory: "Guides"
3+
page_title: "Changelog"
4+
description: |-
5+
Changelog
6+
---
7+
8+
# Changelog
9+
1010
## 0.6.3 (unreleased)
1111

12-
- Fix issue, where NAT is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
12+
- Fix issue, where NAT IPv4 and IPv6 is always configured on `sdwan_transport_wan_vpn_interface_ethernet_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/485)
1313
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
1414

15-
1615
## 0.6.2
1716

1817
- Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417)
@@ -453,4 +452,4 @@ description: |-
453452
## 0.1.0 (July 23, 2021)
454453

455454
- Initial Release
456-
455+

0 commit comments

Comments
 (0)