Skip to content

[UX2.0] Service lan_vpn_feature static route gateway configuration enhancement #468

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 5 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
- Add `sdwan_policy_group` resource and data source
- Adds `enhanced_app_aware_routing` support to the `sdwan_cisco_system_feature_template` resource and data source
- Add `gateway` attribute for `ipv4_static_routes` and `ipv6_static_routes` in `sdwan_service_lan_vpn_feature` resource

## 0.6.2

Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/service_lan_vpn_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ Read-Only:

Read-Only:

- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
- `dhcp` (Boolean) IPv4 Route Gateway DHCP
- `gateway` (String) Gateway type
- `network_address` (String) IP Address
- `network_address_variable` (String) Variable name
- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
Expand Down Expand Up @@ -236,6 +237,7 @@ Read-Only:

Read-Only:

- `gateway` (String) Gateway type
- `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))
Expand Down
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description: |-
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
- Add `sdwan_policy_group` resource and data source
- Adds `enhanced_app_aware_routing` support to the `sdwan_cisco_system_feature_template` resource and data source
- Add `gateway` attribute for `ipv4_static_routes` and `ipv6_static_routes` in `sdwan_service_lan_vpn_feature` resource

## 0.6.2

Expand Down
26 changes: 16 additions & 10 deletions docs/resources/service_lan_vpn_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resource "sdwan_service_lan_vpn_feature" "example" {
{
network_address = "1.2.3.4"
subnet_mask = "0.0.0.0"
gateway = "nextHop"
next_hops = [
{
address = "1.2.3.4"
Expand All @@ -48,7 +49,8 @@ resource "sdwan_service_lan_vpn_feature" "example" {
]
ipv6_static_routes = [
{
prefix = "2001:0:0:1::0/12"
prefix = "2001:0:0:1::0/12"
gateway = "nextHop"
next_hops = [
{
address = "2001:0:0:1::0"
Expand Down Expand Up @@ -323,16 +325,18 @@ Optional:

Optional:

- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
- `dhcp` (Boolean) IPv4 Route Gateway DHCP, Attribute conditional on `gateway` being equal to `dhcp`
- `gateway` (String) Gateway type
- Choices: `nextHop`, `null0`, `vpn`, `dhcp`
- `network_address` (String) IP Address
- `network_address_variable` (String) Variable name
- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
- `null0` (Boolean) IPv4 Route Gateway Next Hop
- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
- `null0` (Boolean) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`
- `subnet_mask` (String) Subnet Mask
- 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`
- `subnet_mask_variable` (String) Variable name
- `vpn` (Boolean) IPv4 Route Gateway VPN
- `vpn` (Boolean) IPv4 Route Gateway VPN, Attribute conditional on `gateway` being equal to `vpn`

<a id="nestedatt--ipv4_static_routes--next_hop_with_trackers"></a>
### Nested Schema for `ipv4_static_routes.next_hop_with_trackers`
Expand Down Expand Up @@ -383,11 +387,13 @@ Optional:

Optional:

- `nat` (String) IPv6 Nat
- `gateway` (String) Gateway type
- Choices: `nextHop`, `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
- `nat_variable` (String) Variable name, Attribute conditional on `gateway` being equal to `nat`
- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (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

Expand Down
4 changes: 3 additions & 1 deletion examples/resources/sdwan_service_lan_vpn_feature/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ resource "sdwan_service_lan_vpn_feature" "example" {
{
network_address = "1.2.3.4"
subnet_mask = "0.0.0.0"
gateway = "nextHop"
next_hops = [
{
address = "1.2.3.4"
Expand All @@ -31,7 +32,8 @@ resource "sdwan_service_lan_vpn_feature" "example" {
]
ipv6_static_routes = [
{
prefix = "2001:0:0:1::0/12"
prefix = "2001:0:0:1::0/12"
gateway = "nextHop"
next_hops = [
{
address = "2001:0:0:1::0"
Expand Down
42 changes: 38 additions & 4 deletions gen/definitions/profile_parcels/service_lan_vpn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,18 @@ attributes:
- model_name: subnetMask
data_path: [prefix]
example: 0.0.0.0
- tf_name: gateway
type: String
tf_only: true
description: Gateway type
enum_values: [nextHop, null0, vpn, dhcp]
example: nextHop
- model_name: nextHop
tf_name: next_hops
data_path: [oneOfIpRoute, nextHopContainer]
conditional_attribute:
name: gateway
value: nextHop
attributes:
- model_name: address
id: true
Expand All @@ -128,6 +137,9 @@ attributes:
tf_name: next_hop_with_trackers
data_path: [oneOfIpRoute, nextHopContainer]
exclude_test: true
conditional_attribute:
name: gateway
value: nextHop
attributes:
- model_name: address
example: 1.2.3.4
Expand All @@ -142,24 +154,41 @@ attributes:
data_path: [oneOfIpRoute]
exclude_test: true
example: false
conditional_attribute:
name: gateway
value: null0
- model_name: dhcp
tf_name: gateway_dhcp
data_path: [oneOfIpRoute]
exclude_test: true
example: false
conditional_attribute:
name: gateway
value: dhcp
- model_name: vpn
data_path: [oneOfIpRoute]
exclude_test: true
example: false
conditional_attribute:
name: gateway
value: vpn
- model_name: ipv6Route
tf_name: ipv6_static_routes
attributes:
- model_name: prefix
id: true
example: 2001:0:0:1::0/12
- tf_name: gateway
type: String
tf_only: true
description: Gateway type
enum_values: [nextHop, null0, nat]
example: nextHop
- model_name: nextHop
tf_name: next_hops
data_path: [oneOfIpRoute, nextHopContainer]
conditional_attribute:
name: gateway
value: nextHop
attributes:
- model_name: address
id: true
Expand All @@ -170,11 +199,16 @@ attributes:
- model_name: null0
data_path: [oneOfIpRoute]
exclude_test: true
example: false
conditional_attribute:
name: gateway
value: null0
- model_name: nat
data_path: [oneOfIpRoute]
exclude_test: true
example: NAT64
conditional_attribute:
name: gateway
value: nat
- model_name: service
tf_name: services
attributes:
Expand Down Expand Up @@ -344,7 +378,7 @@ attributes:
exclude_test: true
example: 1b270f6d-479b-47e3-ab0b-51bc6811a303
- model_name: routeLeakBetweenServices
tf_name: route_leak_from_other_services
tf_name: route_leak_from_other_services
exclude_test: true
attributes:
- model_name: sourceVpn
Expand Down Expand Up @@ -374,7 +408,7 @@ attributes:
- model_name: rt
tf_name: route_target
id: true
example: 1.1.1.3:200
example: 1.1.1.3:200
- model_name: exportRtList
tf_name: ipv4_export_route_targets
data_path: [mplsVpnIpv4RouteTarget]
Expand Down
3 changes: 0 additions & 3 deletions gen/definitions/profile_parcels/transport_wan_vpn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,20 @@ attributes:
- model_name: distance
tf_name: administrative_distance
example: 1

- 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

- model_name: service
tf_name: services
attributes:
Expand Down
10 changes: 9 additions & 1 deletion internal/provider/data_source_sdwan_service_lan_vpn_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ func (d *ServiceLANVPNProfileParcelDataSource) Schema(ctx context.Context, req d
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"gateway": schema.StringAttribute{
MarkdownDescription: "Gateway type",
Computed: true,
},
"next_hops": schema.ListNestedAttribute{
MarkdownDescription: "IPv4 Route Gateway Next Hop",
Computed: true,
Expand Down Expand Up @@ -354,7 +358,7 @@ func (d *ServiceLANVPNProfileParcelDataSource) Schema(ctx context.Context, req d
MarkdownDescription: "IPv4 Route Gateway Next Hop",
Computed: true,
},
"gateway_dhcp": schema.BoolAttribute{
"dhcp": schema.BoolAttribute{
MarkdownDescription: "IPv4 Route Gateway DHCP",
Computed: true,
},
Expand All @@ -378,6 +382,10 @@ func (d *ServiceLANVPNProfileParcelDataSource) Schema(ctx context.Context, req d
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"gateway": schema.StringAttribute{
MarkdownDescription: "Gateway type",
Computed: true,
},
"next_hops": schema.ListNestedAttribute{
MarkdownDescription: "IPv6 Route Gateway Next Hop",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ func testAccDataSourceSdwanServiceLANVPNProfileParcelConfig() string {
config += ` ipv4_static_routes = [{` + "\n"
config += ` network_address = "1.2.3.4"` + "\n"
config += ` subnet_mask = "0.0.0.0"` + "\n"
config += ` gateway = "nextHop"` + "\n"
config += ` next_hops = [{` + "\n"
config += ` address = "1.2.3.4"` + "\n"
config += ` administrative_distance = 1` + "\n"
config += ` }]` + "\n"
config += ` }]` + "\n"
config += ` ipv6_static_routes = [{` + "\n"
config += ` prefix = "2001:0:0:1::0/12"` + "\n"
config += ` gateway = "nextHop"` + "\n"
config += ` next_hops = [{` + "\n"
config += ` address = "2001:0:0:1::0"` + "\n"
config += ` administrative_distance = 1` + "\n"
Expand Down
Loading
Loading