diff --git a/docs/data-sources/transport_management_vpn_feature.md b/docs/data-sources/transport_management_vpn_feature.md index 172b28ae..51e60669 100644 --- a/docs/data-sources/transport_management_vpn_feature.md +++ b/docs/data-sources/transport_management_vpn_feature.md @@ -77,6 +77,7 @@ Read-Only: Read-Only: +- `gateway` (String) Gateway - `nat` (String) IPv6 Nat - `nat_variable` (String) Variable name - `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops)) diff --git a/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md b/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md index e8380df7..d3add630 100644 --- a/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md +++ b/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md @@ -56,6 +56,7 @@ data "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { - `ipv4_address_variable` (String) Variable name - `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth - `ipv4_auto_detect_bandwidth_variable` (String) Variable name +- `ipv4_configuration_type` (String) IPv4 Configuration Type - `ipv4_dhcp_distance` (Number) DHCP Distance - `ipv4_dhcp_distance_variable` (String) Variable name - `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8) @@ -67,6 +68,7 @@ data "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { - `ipv4_subnet_mask_variable` (String) Variable name - `ipv6_address` (String) IPv6 Address Secondary - `ipv6_address_variable` (String) Variable name +- `ipv6_configuration_type` (String) IPv6 Configuration Type - `load_interval` (Number) Interval for interface load calculation - `load_interval_variable` (String) Variable name - `mac_address` (String) MAC Address diff --git a/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md b/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md index bd9c3152..d45d31eb 100644 --- a/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md +++ b/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md @@ -66,6 +66,7 @@ data "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { - `iperf_server_variable` (String) Variable name - `ipv4_address` (String) IP Address - `ipv4_address_variable` (String) Variable name +- `ipv4_configuration_type` (String) IPv4 Configuration Type - `ipv4_dhcp_distance` (Number) DHCP Distance - `ipv4_dhcp_distance_variable` (String) Variable name - `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8) @@ -75,6 +76,7 @@ data "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { - `ipv4_subnet_mask_variable` (String) Variable name - `ipv6_address` (String) IPv6 Address Secondary - `ipv6_address_variable` (String) Variable name +- `ipv6_configuration_type` (String) IPv6 Configuration Type - `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address)) - `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses)) - `load_interval` (Number) Interval for interface load calculation diff --git a/docs/resources/transport_management_vpn_feature.md b/docs/resources/transport_management_vpn_feature.md index 3faf7a5e..4e2dc414 100644 --- a/docs/resources/transport_management_vpn_feature.md +++ b/docs/resources/transport_management_vpn_feature.md @@ -45,7 +45,8 @@ resource "sdwan_transport_management_vpn_feature" "example" { ] ipv6_static_routes = [ { - prefix = "2002::/16" + prefix = "2002::/16" + gateway = "next_hop" next_hops = [ { address = "2001:0:0:1::1" @@ -125,11 +126,13 @@ Optional: Optional: -- `nat` (String) IPv6 Nat +- `gateway` (String) Gateway + - Choices: `next_hop`, `null0`, `nat` +- `nat` (String) IPv6 Nat, Attribute conditional on `gateway` being equal to `nat` - Choices: `NAT64`, `NAT66` - `nat_variable` (String) Variable name -- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops)) -- `null0` (Boolean) IPv6 Route Gateway Next Hop +- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop` (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops)) +- `null0` (Boolean) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0` - `prefix` (String) Prefix - `prefix_variable` (String) Variable name @@ -142,6 +145,7 @@ Optional: - `address_variable` (String) Variable name - `administrative_distance` (Number) Administrative distance - Range: `1`-`254` + - Default value: `1` - `administrative_distance_variable` (String) Variable name diff --git a/docs/resources/transport_management_vpn_interface_ethernet_feature.md b/docs/resources/transport_management_vpn_interface_ethernet_feature.md index 9d085cd3..c5dbedf5 100644 --- a/docs/resources/transport_management_vpn_interface_ethernet_feature.md +++ b/docs/resources/transport_management_vpn_interface_ethernet_feature.md @@ -23,6 +23,7 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { shutdown = true interface_name = "GigabitEthernet1" interface_description = "Transport Management VPN Interface Ethernet" + ipv4_configuration_type = "static" ipv4_address = "1.2.3.4" ipv4_subnet_mask = "0.0.0.0" ipv4_secondary_addresses = [ @@ -34,6 +35,7 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { ipv4_dhcp_helper = ["1.2.3.4"] ipv4_iperf_server = "example" ipv4_auto_detect_bandwidth = false + ipv6_configuration_type = "static" ipv6_address = "2001:0:0:1::/64" arp_entries = [ { @@ -76,7 +78,7 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { - `duplex` (String) Duplex mode - Choices: `full`, `half`, `auto` - `duplex_variable` (String) Variable name -- `enable_dhcpv6` (Boolean) Enable DHCPv6 +- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic` - `feature_profile_id` (String) Feature Profile ID - `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable - Default value: `true` @@ -96,24 +98,29 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { - Range: `576`-`9216` - Default value: `1500` - `ip_mtu_variable` (String) Variable name -- `ipv4_address` (String) IP Address +- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static` - `ipv4_address_variable` (String) Variable name - `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth - Default value: `false` - `ipv4_auto_detect_bandwidth_variable` (String) Variable name -- `ipv4_dhcp_distance` (Number) DHCP Distance +- `ipv4_configuration_type` (String) IPv4 Configuration Type + - Choices: `dynamic`, `static` +- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic` - Range: `1`-`65536` + - Default value: `1` - `ipv4_dhcp_distance_variable` (String) Variable name - `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8) - `ipv4_dhcp_helper_variable` (String) Variable name - `ipv4_iperf_server` (String) Iperf server for auto bandwidth detect - `ipv4_iperf_server_variable` (String) Variable name -- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses)) -- `ipv4_subnet_mask` (String) Subnet Mask +- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses)) +- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static` - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0` - `ipv4_subnet_mask_variable` (String) Variable name -- `ipv6_address` (String) IPv6 Address Secondary +- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static` - `ipv6_address_variable` (String) Variable name +- `ipv6_configuration_type` (String) IPv6 Configuration Type + - Choices: `dynamic`, `static`, `none` - `load_interval` (Number) Interval for interface load calculation - Range: `30`-`600` - Default value: `30` diff --git a/docs/resources/transport_wan_vpn_interface_ethernet_feature.md b/docs/resources/transport_wan_vpn_interface_ethernet_feature.md index cc3b4eb9..1b61f3e4 100644 --- a/docs/resources/transport_wan_vpn_interface_ethernet_feature.md +++ b/docs/resources/transport_wan_vpn_interface_ethernet_feature.md @@ -23,6 +23,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { shutdown = true interface_name = "GigabitEthernet1" interface_description = "WAN" + ipv4_configuration_type = "static" ipv4_address = "1.2.3.4" ipv4_subnet_mask = "0.0.0.0" ipv4_secondary_addresses = [ @@ -32,6 +33,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { } ] ipv4_dhcp_helper = ["1.2.3.4"] + ipv6_configuration_type = "static" iperf_server = "example" block_non_source_ip = false service_provider = "example" @@ -163,7 +165,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { - `duplex` (String) Duplex mode - Choices: `full`, `half`, `auto` - `duplex_variable` (String) Variable name -- `enable_dhcpv6` (Boolean) Enable DHCPv6 +- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic` - `gre_tunnel_source_ip` (String) GRE tunnel source IP - `gre_tunnel_source_ip_variable` (String) Variable name - `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable @@ -186,21 +188,26 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { - `ip_mtu_variable` (String) Variable name - `iperf_server` (String) Iperf server for auto bandwidth detect - `iperf_server_variable` (String) Variable name -- `ipv4_address` (String) IP Address +- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static` - `ipv4_address_variable` (String) Variable name -- `ipv4_dhcp_distance` (Number) DHCP Distance +- `ipv4_configuration_type` (String) IPv4 Configuration Type + - Choices: `dynamic`, `static` +- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic` - Range: `1`-`65536` + - Default value: `1` - `ipv4_dhcp_distance_variable` (String) Variable name - `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8) - `ipv4_dhcp_helper_variable` (String) Variable name -- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses)) -- `ipv4_subnet_mask` (String) Subnet Mask +- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses)) +- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static` - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0` - `ipv4_subnet_mask_variable` (String) Variable name -- `ipv6_address` (String) IPv6 Address Secondary +- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static` - `ipv6_address_variable` (String) Variable name -- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address)) -- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses)) +- `ipv6_configuration_type` (String) IPv6 Configuration Type + - Choices: `dynamic`, `static`, `none` +- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic` (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address)) +- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv6_secondary_addresses)) - `load_interval` (Number) Interval for interface load calculation - Range: `30`-`600` - Default value: `30` diff --git a/examples/resources/sdwan_transport_management_vpn_feature/resource.tf b/examples/resources/sdwan_transport_management_vpn_feature/resource.tf index b3a80ca3..4cc3a0cc 100644 --- a/examples/resources/sdwan_transport_management_vpn_feature/resource.tf +++ b/examples/resources/sdwan_transport_management_vpn_feature/resource.tf @@ -28,7 +28,8 @@ resource "sdwan_transport_management_vpn_feature" "example" { ] ipv6_static_routes = [ { - prefix = "2002::/16" + prefix = "2002::/16" + gateway = "next_hop" next_hops = [ { address = "2001:0:0:1::1" diff --git a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf index f4e603e4..461a8413 100644 --- a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf +++ b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf @@ -6,6 +6,7 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { shutdown = true interface_name = "GigabitEthernet1" interface_description = "Transport Management VPN Interface Ethernet" + ipv4_configuration_type = "static" ipv4_address = "1.2.3.4" ipv4_subnet_mask = "0.0.0.0" ipv4_secondary_addresses = [ @@ -17,6 +18,7 @@ resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" { ipv4_dhcp_helper = ["1.2.3.4"] ipv4_iperf_server = "example" ipv4_auto_detect_bandwidth = false + ipv6_configuration_type = "static" ipv6_address = "2001:0:0:1::/64" arp_entries = [ { diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf index a0c479d5..60d35b05 100644 --- a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf +++ b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf @@ -6,6 +6,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { shutdown = true interface_name = "GigabitEthernet1" interface_description = "WAN" + ipv4_configuration_type = "static" ipv4_address = "1.2.3.4" ipv4_subnet_mask = "0.0.0.0" ipv4_secondary_addresses = [ @@ -15,6 +16,7 @@ resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" { } ] ipv4_dhcp_helper = ["1.2.3.4"] + ipv6_configuration_type = "static" iperf_server = "example" block_non_source_ip = false service_provider = "example" diff --git a/gen/definitions/profile_parcels/transport_management_vpn.yaml b/gen/definitions/profile_parcels/transport_management_vpn.yaml index 7e3a1aab..86fa3d9b 100644 --- a/gen/definitions/profile_parcels/transport_management_vpn.yaml +++ b/gen/definitions/profile_parcels/transport_management_vpn.yaml @@ -66,12 +66,16 @@ attributes: - model_name: distance tf_name: administrative_distance example: 1 + default_value: 1 + default_value_present: true - model_name: distance tf_name: administrative_distance exclude_test: true conditional_attribute: name: gateway value: null0 + default_value: 1 + default_value_present: true example: 1 - model_name: ipv6Route tf_name: ipv6_static_routes @@ -79,10 +83,19 @@ attributes: - model_name: prefix id: true example: 2002::/16 + - tf_name: gateway + type: String + tf_only: true + description: Gateway + enum_values: [next_hop, null0, nat] + example: next_hop - model_name: nextHop tf_name: next_hops data_path: [oneOfIpRoute, nextHopContainer] mandatory: true + conditional_attribute: + name: gateway + value: next_hop attributes: - model_name: address id: true @@ -90,13 +103,21 @@ attributes: - model_name: distance tf_name: administrative_distance example: 1 + default_value: 1 + default_value_present: true - model_name: null0 data_path: [oneOfIpRoute] exclude_test: true + conditional_attribute: + name: gateway + value: null0 example: true - model_name: nat data_path: [oneOfIpRoute] exclude_test: true + conditional_attribute: + name: gateway + value: nat example: NAT64 test_prerequisites: | diff --git a/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml b/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml index 9a819a66..f9b7f833 100644 --- a/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml +++ b/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml @@ -25,24 +25,46 @@ attributes: - model_name: description tf_name: interface_description example: Transport Management VPN Interface Ethernet + + - tf_name: ipv4_configuration_type + type: String + tf_only: true + description: IPv4 Configuration Type + enum_values: [dynamic, static] + example: static + - model_name: dynamicDhcpDistance tf_name: ipv4_dhcp_distance data_path: [intfIpAddress, dynamic] + conditional_attribute: + name: ipv4_configuration_type + value: dynamic + default_value_present: true + default_value: 1 example: 1 exclude_test: true - model_name: ipAddress tf_name: ipv4_address data_path: [intfIpAddress, static, staticIpV4AddressPrimary] + conditional_attribute: + name: ipv4_configuration_type + value: static example: 1.2.3.4 minimum_test_value: '"1.2.3.4"' - model_name: subnetMask tf_name: ipv4_subnet_mask data_path: [intfIpAddress, static, staticIpV4AddressPrimary] + conditional_attribute: + name: ipv4_configuration_type + value: static example: 0.0.0.0 minimum_test_value: '"0.0.0.0"' - model_name: staticIpV4AddressSecondary tf_name: ipv4_secondary_addresses data_path: [intfIpAddress, static] + conditional_attribute: + name: ipv4_configuration_type + value: static attributes: - model_name: ipAddress tf_name: address @@ -59,15 +81,29 @@ attributes: - model_name: autoDetectBandwidth tf_name: ipv4_auto_detect_bandwidth example: false + + - tf_name: ipv6_configuration_type + type: String + tf_only: true + description: IPv6 Configuration Type + enum_values: [dynamic, static, none] + example: static + - model_name: dhcpClient tf_name: enable_dhcpv6 data_path: [intfIpV6Address, dynamic] type: Bool + conditional_attribute: + name: ipv6_configuration_type + value: dynamic example: true exclude_test: true - model_name: address tf_name: ipv6_address data_path: [intfIpV6Address, static, primaryIpV6Address] + conditional_attribute: + name: ipv6_configuration_type + value: static example: 2001:0:0:1::/64 - model_name: arp tf_name: arp_entries diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml index 69bf1ec0..4d3d85c9 100644 --- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml +++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml @@ -26,24 +26,46 @@ attributes: - model_name: description tf_name: interface_description example: WAN + + - tf_name: ipv4_configuration_type + type: String + tf_only: true + description: IPv4 Configuration Type + enum_values: [dynamic, static] + example: static + - model_name: dynamicDhcpDistance tf_name: ipv4_dhcp_distance data_path: [intfIpAddress, dynamic] + conditional_attribute: + name: ipv4_configuration_type + value: dynamic + default_value_present: true + default_value: 1 example: 1 exclude_test: true - model_name: ipAddress tf_name: ipv4_address data_path: [intfIpAddress, static, staticIpV4AddressPrimary] + conditional_attribute: + name: ipv4_configuration_type + value: static example: 1.2.3.4 minimum_test_value: '"1.2.3.4"' - model_name: subnetMask tf_name: ipv4_subnet_mask data_path: [intfIpAddress, static, staticIpV4AddressPrimary] + conditional_attribute: + name: ipv4_configuration_type + value: static example: 0.0.0.0 minimum_test_value: '"0.0.0.0"' - model_name: staticIpV4AddressSecondary tf_name: ipv4_secondary_addresses data_path: [intfIpAddress, static] + conditional_attribute: + name: ipv4_configuration_type + value: static attributes: - model_name: ipAddress tf_name: address @@ -54,14 +76,28 @@ attributes: - model_name: dhcpHelper tf_name: ipv4_dhcp_helper example: 1.2.3.4 + + - tf_name: ipv6_configuration_type + type: String + tf_only: true + description: IPv6 Configuration Type + enum_values: [dynamic, static, none] + example: static + - model_name: dhcpClient tf_name: enable_dhcpv6 data_path: [intfIpV6Address, dynamic] + conditional_attribute: + name: ipv6_configuration_type + value: dynamic exclude_test: true example: false - model_name: secondaryIpV6Address tf_name: ipv6_dhcp_secondary_address data_path: [intfIpV6Address, dynamic] + conditional_attribute: + name: ipv6_configuration_type + value: dynamic exclude_null: true exclude_test: true attributes: @@ -71,11 +107,17 @@ attributes: - model_name: address tf_name: ipv6_address data_path: [intfIpV6Address, static, primaryIpV6Address] + conditional_attribute: + name: ipv6_configuration_type + value: static exclude_test: true example: 2001:0:0:1::0 - model_name: secondaryIpV6Address tf_name: ipv6_secondary_addresses data_path: [intfIpV6Address, static] + conditional_attribute: + name: ipv6_configuration_type + value: static exclude_null: true exclude_test: true attributes: diff --git a/gen/templates/profile_parcels/model.go b/gen/templates/profile_parcels/model.go index 146d4019..84b6412d 100644 --- a/gen/templates/profile_parcels/model.go +++ b/gen/templates/profile_parcels/model.go @@ -168,7 +168,7 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) } - {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference)}} + {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .TfOnly) (not .Reference)}} {{if .Variable}} if !data.{{toGoName .TfName}}Variable.IsNull() { if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { @@ -205,7 +205,7 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) } - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .TfOnly)}} {{if .Variable}} if !item.{{toGoName .TfName}}Variable.IsNull() { if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { @@ -279,7 +279,7 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string { itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) } - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .TfOnly)}} {{if .Variable}} if !childChildItem.{{toGoName .TfName}}Variable.IsNull() { if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { @@ -336,7 +336,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) path := "payload.data." {{- range .Attributes}} {{- $cname := toGoName .TfName}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -354,7 +354,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) item := {{$name}}{{toGoName .TfName}}{} {{- range .Attributes}} {{- $ccname := toGoName .TfName}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} item.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}item.{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -371,7 +371,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) cValue.ForEach(func(ck, cv gjson.Result) bool { cItem := {{$name}}{{$cname}}{{toGoName .TfName}}{} {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} cItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}cItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -388,7 +388,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) ccValue.ForEach(func(cck, ccv gjson.Result) bool { ccItem := {{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}{} {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} ccItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}ccItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := ccv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -432,7 +432,7 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R } path := "payload.data." {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -476,7 +476,7 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R ) {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} data.{{$list}}[i].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -520,7 +520,7 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R ) {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { @@ -564,7 +564,7 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R ) {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .TfOnly) (not .WriteOnly) (not .Value)}} data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} if t := ccr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_feature.go b/internal/provider/data_source_sdwan_transport_management_vpn_feature.go index bfbf2666..8fe8e50b 100644 --- a/internal/provider/data_source_sdwan_transport_management_vpn_feature.go +++ b/internal/provider/data_source_sdwan_transport_management_vpn_feature.go @@ -217,6 +217,10 @@ func (d *TransportManagementVPNProfileParcelDataSource) Schema(ctx context.Conte MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, + "gateway": schema.StringAttribute{ + MarkdownDescription: "Gateway", + Computed: true, + }, "next_hops": schema.ListNestedAttribute{ MarkdownDescription: "IPv6 Route Gateway Next Hop", Computed: true, diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go index e18d4392..1664a4e8 100644 --- a/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go +++ b/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go @@ -45,6 +45,7 @@ func TestAccDataSourceSdwanTransportManagementVPNProfileParcel(t *testing.T) { checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.prefix", "2002::/16")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.gateway", "next_hop")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1")) resource.Test(t, resource.TestCase{ @@ -98,6 +99,7 @@ func testAccDataSourceSdwanTransportManagementVPNProfileParcelConfig() string { config += ` }]` + "\n" config += ` ipv6_static_routes = [{` + "\n" config += ` prefix = "2002::/16"` + "\n" + config += ` gateway = "next_hop"` + "\n" config += ` next_hops = [{` + "\n" config += ` address = "2001:0:0:1::1"` + "\n" config += ` administrative_distance = 1` + "\n" diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go index 0d280142..ee948433 100644 --- a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go +++ b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go @@ -107,6 +107,10 @@ func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Schema( MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, + "ipv4_configuration_type": schema.StringAttribute{ + MarkdownDescription: "IPv4 Configuration Type", + Computed: true, + }, "ipv4_dhcp_distance": schema.Int64Attribute{ MarkdownDescription: "DHCP Distance", Computed: true, @@ -180,6 +184,10 @@ func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Schema( MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, + "ipv6_configuration_type": schema.StringAttribute{ + MarkdownDescription: "IPv6 Configuration Type", + Computed: true, + }, "enable_dhcpv6": schema.BoolAttribute{ MarkdownDescription: "Enable DHCPv6", Computed: true, diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go index 7a39c5b5..679bbfd0 100644 --- a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go +++ b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go @@ -36,12 +36,14 @@ func TestAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcel( checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "shutdown", "true")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_description", "Transport Management VPN Interface Ethernet")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_iperf_server", "example")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_auto_detect_bandwidth", "false")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_address", "2001:0:0:1::/64")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.ip_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26")) @@ -96,6 +98,7 @@ func testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelC config += ` shutdown = true` + "\n" config += ` interface_name = "GigabitEthernet1"` + "\n" config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n" + config += ` ipv4_configuration_type = "static"` + "\n" config += ` ipv4_address = "1.2.3.4"` + "\n" config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n" config += ` ipv4_secondary_addresses = [{` + "\n" @@ -105,6 +108,7 @@ func testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelC config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n" config += ` ipv4_iperf_server = "example"` + "\n" config += ` ipv4_auto_detect_bandwidth = false` + "\n" + config += ` ipv6_configuration_type = "static"` + "\n" config += ` ipv6_address = "2001:0:0:1::/64"` + "\n" config += ` arp_entries = [{` + "\n" config += ` ip_address = "1.2.3.4"` + "\n" diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go index 3a99e7bc..b7824d23 100644 --- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go +++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go @@ -107,6 +107,10 @@ func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Schema(ctx con MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, + "ipv4_configuration_type": schema.StringAttribute{ + MarkdownDescription: "IPv4 Configuration Type", + Computed: true, + }, "ipv4_dhcp_distance": schema.Int64Attribute{ MarkdownDescription: "DHCP Distance", Computed: true, @@ -164,6 +168,10 @@ func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Schema(ctx con MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, + "ipv6_configuration_type": schema.StringAttribute{ + MarkdownDescription: "IPv6 Configuration Type", + Computed: true, + }, "enable_dhcpv6": schema.BoolAttribute{ MarkdownDescription: "Enable DHCPv6", Computed: true, diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go index 12e8dd52..1b684b26 100644 --- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go +++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go @@ -36,10 +36,12 @@ func TestAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *test checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "shutdown", "true")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_description", "WAN")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "iperf_server", "example")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "block_non_source_ip", "false")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "service_provider", "example")) @@ -208,6 +210,7 @@ func testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig() config += ` shutdown = true` + "\n" config += ` interface_name = "GigabitEthernet1"` + "\n" config += ` interface_description = "WAN"` + "\n" + config += ` ipv4_configuration_type = "static"` + "\n" config += ` ipv4_address = "1.2.3.4"` + "\n" config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n" config += ` ipv4_secondary_addresses = [{` + "\n" @@ -215,6 +218,7 @@ func testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig() config += ` subnet_mask = "0.0.0.0"` + "\n" config += ` }]` + "\n" config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n" + config += ` ipv6_configuration_type = "static"` + "\n" config += ` iperf_server = "example"` + "\n" config += ` block_non_source_ip = false` + "\n" config += ` service_provider = "example"` + "\n" diff --git a/internal/provider/model_sdwan_transport_management_vpn_feature.go b/internal/provider/model_sdwan_transport_management_vpn_feature.go index d87d8933..5df4be26 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_feature.go +++ b/internal/provider/model_sdwan_transport_management_vpn_feature.go @@ -74,6 +74,7 @@ type TransportManagementVPNIpv4StaticRoutes struct { type TransportManagementVPNIpv6StaticRoutes struct { Prefix types.String `tfsdk:"prefix"` PrefixVariable types.String `tfsdk:"prefix_variable"` + Gateway types.String `tfsdk:"gateway"` NextHops []TransportManagementVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"` Null0 types.Bool `tfsdk:"null0"` Nat types.String `tfsdk:"nat"` @@ -349,7 +350,7 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) } } - if true { + if true && item.Gateway.ValueString() == "next_hop" { for _, childItem := range item.NextHops { itemChildBody := "" @@ -371,7 +372,12 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } - } else if !childItem.AdministrativeDistance.IsNull() { + } else if childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) + } + } else { if true { itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) @@ -381,19 +387,19 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } if !item.Null0.IsNull() { - if true { + if true && item.Gateway.ValueString() == "null0" { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) } } if !item.NatVariable.IsNull() { - if true { + if true && item.Gateway.ValueString() == "nat" { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) } } else if !item.Nat.IsNull() { - if true { + if true && item.Gateway.ValueString() == "nat" { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) } diff --git a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go index 67c9b9b8..49844f15 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go +++ b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go @@ -45,6 +45,7 @@ type TransportManagementVPNInterfaceEthernet struct { InterfaceNameVariable types.String `tfsdk:"interface_name_variable"` InterfaceDescription types.String `tfsdk:"interface_description"` InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"` + Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"` Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"` Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"` Ipv4Address types.String `tfsdk:"ipv4_address"` @@ -58,6 +59,7 @@ type TransportManagementVPNInterfaceEthernet struct { Ipv4IperfServerVariable types.String `tfsdk:"ipv4_iperf_server_variable"` Ipv4AutoDetectBandwidth types.Bool `tfsdk:"ipv4_auto_detect_bandwidth"` Ipv4AutoDetectBandwidthVariable types.String `tfsdk:"ipv4_auto_detect_bandwidth_variable"` + Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"` EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"` Ipv6Address types.String `tfsdk:"ipv6_address"` Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"` @@ -172,41 +174,46 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } if !data.Ipv4DhcpDistanceVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) } - } else if !data.Ipv4DhcpDistance.IsNull() { - if true { + } else if data.Ipv4DhcpDistance.IsNull() { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1) + } + } else { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) } } if !data.Ipv4AddressVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) } } if !data.Ipv4SubnetMaskVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) } } - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { for _, item := range data.Ipv4SecondaryAddresses { itemBody := "" @@ -291,19 +298,19 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } if !data.EnableDhcpv6.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) } } if !data.Ipv6AddressVariable.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) } } else if !data.Ipv6Address.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) } @@ -1212,6 +1219,9 @@ func (data *TransportManagementVPNInterfaceEthernet) isNull(ctx context.Context, if !data.InterfaceDescriptionVariable.IsNull() { return false } + if !data.Ipv4ConfigurationType.IsNull() { + return false + } if !data.Ipv4DhcpDistance.IsNull() { return false } @@ -1251,6 +1261,9 @@ func (data *TransportManagementVPNInterfaceEthernet) isNull(ctx context.Context, if !data.Ipv4AutoDetectBandwidthVariable.IsNull() { return false } + if !data.Ipv6ConfigurationType.IsNull() { + return false + } if !data.EnableDhcpv6.IsNull() { return false } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go index 6bb64a29..bc9b410d 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go @@ -45,6 +45,7 @@ type TransportWANVPNInterfaceEthernet struct { InterfaceNameVariable types.String `tfsdk:"interface_name_variable"` InterfaceDescription types.String `tfsdk:"interface_description"` InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"` + Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"` Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"` Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"` Ipv4Address types.String `tfsdk:"ipv4_address"` @@ -54,6 +55,7 @@ type TransportWANVPNInterfaceEthernet struct { Ipv4SecondaryAddresses []TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"` Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"` Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"` + Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"` EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"` Ipv6DhcpSecondaryAddress []TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress `tfsdk:"ipv6_dhcp_secondary_address"` Ipv6Address types.String `tfsdk:"ipv6_address"` @@ -346,41 +348,46 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } if !data.Ipv4DhcpDistanceVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) } - } else if !data.Ipv4DhcpDistance.IsNull() { - if true { + } else if data.Ipv4DhcpDistance.IsNull() { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1) + } + } else { + if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) } } if !data.Ipv4AddressVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) } } if !data.Ipv4SubnetMaskVariable.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) } } - if true { + if true && data.Ipv4ConfigurationType.ValueString() == "static" { for _, item := range data.Ipv4SecondaryAddresses { itemBody := "" @@ -431,12 +438,12 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } if !data.EnableDhcpv6.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" { body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) } } - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" { for _, item := range data.Ipv6DhcpSecondaryAddress { itemBody := "" @@ -457,17 +464,17 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } if !data.Ipv6AddressVariable.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) } } else if !data.Ipv6Address.IsNull() { - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "static" { body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) } } - if true { + if true && data.Ipv6ConfigurationType.ValueString() == "static" { for _, item := range data.Ipv6SecondaryAddresses { itemBody := "" @@ -4400,6 +4407,9 @@ func (data *TransportWANVPNInterfaceEthernet) isNull(ctx context.Context, res gj if !data.InterfaceDescriptionVariable.IsNull() { return false } + if !data.Ipv4ConfigurationType.IsNull() { + return false + } if !data.Ipv4DhcpDistance.IsNull() { return false } @@ -4427,6 +4437,9 @@ func (data *TransportWANVPNInterfaceEthernet) isNull(ctx context.Context, res gj if !data.Ipv4DhcpHelperVariable.IsNull() { return false } + if !data.Ipv6ConfigurationType.IsNull() { + return false + } if !data.EnableDhcpv6.IsNull() { return false } diff --git a/internal/provider/resource_sdwan_transport_management_vpn_feature.go b/internal/provider/resource_sdwan_transport_management_vpn_feature.go index e12ea60b..f2dca228 100644 --- a/internal/provider/resource_sdwan_transport_management_vpn_feature.go +++ b/internal/provider/resource_sdwan_transport_management_vpn_feature.go @@ -248,8 +248,15 @@ func (r *TransportManagementVPNProfileParcelResource) Schema(ctx context.Context MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, + "gateway": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("next_hop", "null0", "nat").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("next_hop", "null0", "nat"), + }, + }, "next_hops": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -262,7 +269,7 @@ func (r *TransportManagementVPNProfileParcelResource) Schema(ctx context.Context Optional: true, }, "administrative_distance": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).String, + MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("1").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(1, 254), @@ -276,11 +283,11 @@ func (r *TransportManagementVPNProfileParcelResource) Schema(ctx context.Context }, }, "null0": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`").String, Optional: true, }, "nat": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat").AddStringEnumDescription("NAT64", "NAT66").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat, Attribute conditional on `gateway` being equal to `nat`").AddStringEnumDescription("NAT64", "NAT66").String, Optional: true, Validators: []validator.String{ stringvalidator.OneOf("NAT64", "NAT66"), diff --git a/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go b/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go index 7d90df51..3bc39891 100644 --- a/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go +++ b/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go @@ -45,6 +45,7 @@ func TestAccSdwanTransportManagementVPNProfileParcel(t *testing.T) { checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.prefix", "2002::/16")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.gateway", "next_hop")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1")) resource.Test(t, resource.TestCase{ @@ -113,6 +114,7 @@ func testAccSdwanTransportManagementVPNProfileParcelConfig_all() string { config += ` }]` + "\n" config += ` ipv6_static_routes = [{` + "\n" config += ` prefix = "2002::/16"` + "\n" + config += ` gateway = "next_hop"` + "\n" config += ` next_hops = [{` + "\n" config += ` address = "2001:0:0:1::1"` + "\n" config += ` administrative_distance = 1` + "\n" diff --git a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go index b40b5963..4c9a13d0 100644 --- a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go +++ b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go @@ -124,8 +124,15 @@ func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Schema(ct MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, + "ipv4_configuration_type": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("dynamic", "static"), + }, + }, "ipv4_dhcp_distance": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance").AddIntegerRangeDescription(1, 65536).String, + MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(1, 65536), @@ -136,7 +143,7 @@ func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Schema(ct Optional: true, }, "ipv4_address": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IP Address").String, + MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String, Optional: true, }, "ipv4_address_variable": schema.StringAttribute{ @@ -144,7 +151,7 @@ func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Schema(ct Optional: true, }, "ipv4_subnet_mask": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String, + MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String, Optional: true, Validators: []validator.String{ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"), @@ -155,7 +162,7 @@ func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Schema(ct Optional: true, }, "ipv4_secondary_addresses": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses").String, + MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -206,12 +213,19 @@ func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Schema(ct MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, + "ipv6_configuration_type": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("dynamic", "static", "none"), + }, + }, "enable_dhcpv6": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").String, + MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String, Optional: true, }, "ipv6_address": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String, Optional: true, Validators: []validator.String{ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""), diff --git a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go index 314b92b0..589761eb 100644 --- a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go +++ b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go @@ -36,12 +36,14 @@ func TestAccSdwanTransportManagementVPNInterfaceEthernetProfileParcel(t *testing checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "shutdown", "true")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_description", "Transport Management VPN Interface Ethernet")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_iperf_server", "example")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_auto_detect_bandwidth", "false")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_address", "2001:0:0:1::/64")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.ip_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26")) @@ -115,6 +117,7 @@ func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all( config += ` shutdown = true` + "\n" config += ` interface_name = "GigabitEthernet1"` + "\n" config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n" + config += ` ipv4_configuration_type = "static"` + "\n" config += ` ipv4_address = "1.2.3.4"` + "\n" config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n" config += ` ipv4_secondary_addresses = [{` + "\n" @@ -124,6 +127,7 @@ func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all( config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n" config += ` ipv4_iperf_server = "example"` + "\n" config += ` ipv4_auto_detect_bandwidth = false` + "\n" + config += ` ipv6_configuration_type = "static"` + "\n" config += ` ipv6_address = "2001:0:0:1::/64"` + "\n" config += ` arp_entries = [{` + "\n" config += ` ip_address = "1.2.3.4"` + "\n" diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go index ec8440f3..95627ef0 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go @@ -124,8 +124,15 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, + "ipv4_configuration_type": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("dynamic", "static"), + }, + }, "ipv4_dhcp_distance": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance").AddIntegerRangeDescription(1, 65536).String, + MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(1, 65536), @@ -136,7 +143,7 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte Optional: true, }, "ipv4_address": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IP Address").String, + MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String, Optional: true, }, "ipv4_address_variable": schema.StringAttribute{ @@ -144,7 +151,7 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte Optional: true, }, "ipv4_subnet_mask": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String, + MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String, Optional: true, Validators: []validator.String{ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"), @@ -155,7 +162,7 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte Optional: true, }, "ipv4_secondary_addresses": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses").String, + MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -190,12 +197,19 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, + "ipv6_configuration_type": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("dynamic", "static", "none"), + }, + }, "enable_dhcpv6": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").String, + MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String, Optional: true, }, "ipv6_dhcp_secondary_address": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses").String, + MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -214,7 +228,7 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte }, }, "ipv6_address": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String, Optional: true, Validators: []validator.String{ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""), @@ -225,7 +239,7 @@ func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Schema(ctx conte Optional: true, }, "ipv6_secondary_addresses": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses").String, + MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go index ed149272..83bdbc12 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go @@ -36,10 +36,12 @@ func TestAccSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *testing.T) { checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "shutdown", "true")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_description", "WAN")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "iperf_server", "example")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "block_non_source_ip", "false")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "service_provider", "example")) @@ -227,6 +229,7 @@ func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all() strin config += ` shutdown = true` + "\n" config += ` interface_name = "GigabitEthernet1"` + "\n" config += ` interface_description = "WAN"` + "\n" + config += ` ipv4_configuration_type = "static"` + "\n" config += ` ipv4_address = "1.2.3.4"` + "\n" config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n" config += ` ipv4_secondary_addresses = [{` + "\n" @@ -234,6 +237,7 @@ func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all() strin config += ` subnet_mask = "0.0.0.0"` + "\n" config += ` }]` + "\n" config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n" + config += ` ipv6_configuration_type = "static"` + "\n" config += ` iperf_server = "example"` + "\n" config += ` block_non_source_ip = false` + "\n" config += ` service_provider = "example"` + "\n"