Skip to content

Fix: NAT is always configured on sdwan_transport_wan_vpn_interface_ethernet_feature #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.3 (Unreleased)

- 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)

## 0.6.2

- Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417)
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ description: |-

# Changelog

## 0.6.3 (Unreleased)

- 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)

## 0.6.2

- Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417)
Expand Down
34 changes: 17 additions & 17 deletions docs/resources/transport_wan_vpn_interface_ethernet_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,31 +238,31 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
- `nat_ipv6` (Boolean) enable Network Address Translation ipv6 on this interface
- Default value: `false`
- `nat_ipv6_variable` (String) Variable name
- `nat_loopback` (String) NAT Inside Source Loopback Interface
- `nat_loopback_variable` (String) Variable name
- `nat_overload` (Boolean) NAT Overload
- `nat_loopback` (String) NAT Inside Source Loopback Interface, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_loopback_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_overload` (Boolean) NAT Overload, Attribute conditional on `nat_ipv4` being equal to `true`
- Default value: `true`
- `nat_overload_variable` (String) Variable name
- `nat_prefix_length` (Number) NAT Pool Prefix Length
- `nat_overload_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_prefix_length` (Number) NAT Pool Prefix Length, Attribute conditional on `nat_ipv4` being equal to `true`
- Range: `1`-`32`
- `nat_prefix_length_variable` (String) Variable name
- `nat_range_end` (String) NAT Pool Range End
- `nat_range_end_variable` (String) Variable name
- `nat_range_start` (String) NAT Pool Range Start
- `nat_range_start_variable` (String) Variable name
- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
- `nat_prefix_length_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_range_end` (String) NAT Pool Range End, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_range_end_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_range_start` (String) NAT Pool Range Start, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_range_start_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes, Attribute conditional on `nat_ipv4` being equal to `true`
- Range: `1`-`8947`
- Default value: `60`
- `nat_tcp_timeout_variable` (String) Variable name
- `nat_type` (String) NAT Type
- `nat_tcp_timeout_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_type` (String) NAT Type, Attribute conditional on `nat_ipv4` being equal to `true`
- Choices: `interface`, `pool`, `loopback`
- Default value: `interface`
- `nat_type_variable` (String) Variable name
- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
- `nat_type_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes, Attribute conditional on `nat_ipv4` being equal to `true`
- Range: `1`-`8947`
- Default value: `1`
- `nat_udp_timeout_variable` (String) Variable name
- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
- `nat_udp_timeout_variable` (String) Variable name, Attribute conditional on `nat_ipv4` being equal to `true`
- `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))
- `per_tunnel_qos` (Boolean) Per-tunnel Qos
- Default value: `false`
- `per_tunnel_qos_variable` (String) Variable name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,20 @@ attributes:
- model_name: natType
tf_name: nat_type
data_path: [natAttributesIpv4]
example: interface
example: interface
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
- model_name: rangeStart
tf_name: nat_range_start
data_path: [natAttributesIpv4, natPool]
exclude_test: true
exclude_null: true
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
# conditional_attribute:
# name: natType
# value: pool
Expand All @@ -340,6 +348,10 @@ attributes:
data_path: [natAttributesIpv4, natPool]
exclude_test: true
exclude_null: true
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
# conditional_attribute:
# name: natType
# value: pool
Expand All @@ -349,6 +361,10 @@ attributes:
data_path: [natAttributesIpv4, natPool]
exclude_test: true
exclude_null: true
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
# conditional_attribute:
# name: natType
# value: pool
Expand All @@ -358,6 +374,10 @@ attributes:
data_path: [natAttributesIpv4, natPool]
exclude_test: true
exclude_null: true
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
# conditional_attribute:
# name: natType
# value: pool
Expand All @@ -367,6 +387,10 @@ attributes:
data_path: [natAttributesIpv4]
exclude_test: true
exclude_null: true
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
# conditional_attribute:
# name: natType
# value: loopback
Expand All @@ -375,13 +399,25 @@ attributes:
tf_name: nat_udp_timeout
data_path: [natAttributesIpv4]
example: 1
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
- model_name: tcpTimeout
tf_name: nat_tcp_timeout
data_path: [natAttributesIpv4]
example: 60
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
- model_name: newStaticNat
tf_name: new_static_nats
data_path: [natAttributesIpv4]
conditional_attribute:
name: nat_ipv4
value: true
type: Bool
attributes:
- model_name: sourceIp
id: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1292,116 +1292,116 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string
}

if !data.NatTypeVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatTypeVariable.ValueString())
}
} else if data.NatType.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "default")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface")
}
} else {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString())
}
}

if !data.NatRangeStartVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString())
}
} else if !data.NatRangeStart.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString())
}
}

if !data.NatRangeEndVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString())
}
} else if !data.NatRangeEnd.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString())
}
}

if !data.NatPrefixLengthVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString())
}
} else if !data.NatPrefixLength.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64())
}
}

if !data.NatOverloadVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString())
}
} else if !data.NatOverload.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool())
}
}

if !data.NatLoopbackVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString())
}
} else if !data.NatLoopback.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString())
}
}

if !data.NatUdpTimeoutVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString())
}
} else if data.NatUdpTimeout.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
}
} else {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64())
}
}

if !data.NatTcpTimeoutVariable.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString())
}
} else if data.NatTcpTimeout.IsNull() {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
}
} else {
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64())
}
}
if true {
if true && data.NatIpv4.ValueBool() == true {
body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{})
for _, item := range data.NewStaticNats {
itemBody := ""
Expand Down
Loading