Skip to content

Resolve Issue #475 #476

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from 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 @@ -8,6 +8,7 @@
- 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
- Fix issue causing `sdwan_transport_routing_bgp_feature` to fail to apply when `policy_type` is set to `off`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/475)

## 0.6.2

Expand Down
16 changes: 12 additions & 4 deletions docs/data-sources/service_routing_bgp_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,24 @@ Read-Only:

Read-Only:

- `disable_peer_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- `disable_peer_max_number_of_prefixes_variable` (String) Variable name
- `disable_peer_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- `disable_peer_threshold_variable` (String) Variable name
- `family_type` (String) Set IPv4 unicast address family
- `in_route_policy_id` (String)
- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- `max_number_of_prefixes_variable` (String) Variable name
- `out_route_policy_id` (String)
- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
- `restart_interval_variable` (String) Variable name
- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- `threshold_variable` (String) Variable name
- `restart_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- `restart_max_number_of_prefixes_variable` (String) Variable name
- `restart_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- `restart_threshold_variable` (String) Variable name
- `warning_message_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- `warning_message_max_number_of_prefixes_variable` (String) Variable name
- `warning_message_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- `warning_message_threshold_variable` (String) Variable name



Expand Down
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ description: |-
- 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
- Fix issue causing `sdwan_transport_routing_bgp_feature` to fail to apply when `policy_type` is set to `off`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/475)

## 0.6.2

Expand Down
39 changes: 27 additions & 12 deletions docs/resources/service_routing_bgp_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ resource "sdwan_service_routing_bgp_feature" "example" {
allowas_in_number = 1
address_families = [
{
family_type = "ipv4-unicast"
max_number_of_prefixes = 2000
threshold = 75
policy_type = "restart"
restart_interval = 30
family_type = "ipv4-unicast"
policy_type = "restart"
restart_max_number_of_prefixes = 2000
restart_threshold = 75
restart_interval = 30
}
]
}
Expand Down Expand Up @@ -289,20 +289,35 @@ Optional:

Optional:

- `disable_peer_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer, Attribute conditional on `policy_type` being equal to `disable-peer`
- Range: `1`-`4294967295`
- `disable_peer_max_number_of_prefixes_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `disable-peer`
- `disable_peer_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message, Attribute conditional on `policy_type` being equal to `disable-peer`
- Range: `1`-`100`
- Default value: `75`
- `disable_peer_threshold_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `disable-peer`
- `family_type` (String) Set IPv4 unicast address family
- `in_route_policy_id` (String)
- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- Range: `1`-`4294967295`
- `max_number_of_prefixes_variable` (String) Variable name
- `out_route_policy_id` (String)
- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
- Choices: `restart`, `off`, `warning-only`, `disable-peer`
- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded, Attribute conditional on `policy_type` being equal to `restart`
- Range: `1`-`65535`
- `restart_interval_variable` (String) Variable name
- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- `restart_interval_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `restart`
- `restart_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer, Attribute conditional on `policy_type` being equal to `restart`
- Range: `1`-`4294967295`
- `restart_max_number_of_prefixes_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `restart`
- `restart_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message, Attribute conditional on `policy_type` being equal to `restart`
- Range: `1`-`100`
- Default value: `75`
- `threshold_variable` (String) Variable name
- `restart_threshold_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `restart`
- `warning_message_max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer, Attribute conditional on `policy_type` being equal to `warning-only`
- Range: `1`-`4294967295`
- `warning_message_max_number_of_prefixes_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `warning-only`
- `warning_message_threshold` (Number) Set threshold(1 to 100) at which to generate a warning message, Attribute conditional on `policy_type` being equal to `warning-only`
- Range: `1`-`100`
- Default value: `75`
- `warning_message_threshold_variable` (String) Variable name, Attribute conditional on `policy_type` being equal to `warning-only`



Expand Down
10 changes: 5 additions & 5 deletions examples/resources/sdwan_service_routing_bgp_feature/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ resource "sdwan_service_routing_bgp_feature" "example" {
allowas_in_number = 1
address_families = [
{
family_type = "ipv4-unicast"
max_number_of_prefixes = 2000
threshold = 75
policy_type = "restart"
restart_interval = 30
family_type = "ipv4-unicast"
policy_type = "restart"
restart_max_number_of_prefixes = 2000
restart_threshold = 75
restart_interval = 30
}
]
}
Expand Down
57 changes: 52 additions & 5 deletions gen/definitions/profile_parcels/service_routing_bgp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,69 @@ attributes:
- model_name: familyType
id: true
example: ipv4-unicast
- model_name: policyType
data_path: [maxPrefixConfig]
type: String
enum_values: ['restart', 'off', 'warning-only', 'disable-peer']
example: restart
- model_name: prefixNum
tf_name: max_number_of_prefixes
tf_name: restart_max_number_of_prefixes
data_path: [maxPrefixConfig]
example: 2000
conditional_attribute:
name: policyType
value: restart
- model_name: threshold
tf_name: restart_threshold
data_path: [maxPrefixConfig]
default_value: 75
default_value_present: true
example: 75
- model_name: policyType
data_path: [maxPrefixConfig]
type: String
example: restart
conditional_attribute:
name: policyType
value: restart
- model_name: restartInterval
data_path: [maxPrefixConfig]
example: 30
conditional_attribute:
name: policyType
value: restart
- model_name: prefixNum
tf_name: warning_message_max_number_of_prefixes
data_path: [maxPrefixConfig]
example: 2000
exclude_test: true
conditional_attribute:
name: policyType
value: warning-only
- model_name: threshold
tf_name: warning_message_threshold
data_path: [maxPrefixConfig]
default_value: 75
default_value_present: true
example: 75
exclude_test: true
conditional_attribute:
name: policyType
value: warning-only
- model_name: prefixNum
tf_name: disable_peer_max_number_of_prefixes
data_path: [maxPrefixConfig]
example: 2000
exclude_test: true
conditional_attribute:
name: policyType
value: disable-peer
- model_name: threshold
tf_name: disable_peer_threshold
data_path: [maxPrefixConfig]
default_value: 75
default_value_present: true
example: 75
exclude_test: true
conditional_attribute:
name: policyType
value: disable-peer
- model_name: refId
tf_name: in_route_policy_id
data_path: [inRoutePolicy]
Expand Down
48 changes: 40 additions & 8 deletions internal/provider/data_source_sdwan_service_routing_bgp_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,26 +332,26 @@ func (d *ServiceRoutingBGPProfileParcelDataSource) Schema(ctx context.Context, r
MarkdownDescription: "Set IPv4 unicast address family",
Computed: true,
},
"max_number_of_prefixes": schema.Int64Attribute{
"policy_type": schema.StringAttribute{
MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
Computed: true,
},
"restart_max_number_of_prefixes": schema.Int64Attribute{
MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
Computed: true,
},
"max_number_of_prefixes_variable": schema.StringAttribute{
"restart_max_number_of_prefixes_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"threshold": schema.Int64Attribute{
"restart_threshold": schema.Int64Attribute{
MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
Computed: true,
},
"threshold_variable": schema.StringAttribute{
"restart_threshold_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"policy_type": schema.StringAttribute{
MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
Computed: true,
},
"restart_interval": schema.Int64Attribute{
MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
Computed: true,
Expand All @@ -360,6 +360,38 @@ func (d *ServiceRoutingBGPProfileParcelDataSource) Schema(ctx context.Context, r
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"warning_message_max_number_of_prefixes": schema.Int64Attribute{
MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
Computed: true,
},
"warning_message_max_number_of_prefixes_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"warning_message_threshold": schema.Int64Attribute{
MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
Computed: true,
},
"warning_message_threshold_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"disable_peer_max_number_of_prefixes": schema.Int64Attribute{
MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
Computed: true,
},
"disable_peer_max_number_of_prefixes_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"disable_peer_threshold": schema.Int64Attribute{
MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
Computed: true,
},
"disable_peer_threshold_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"in_route_policy_id": schema.StringAttribute{
MarkdownDescription: "",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func TestAccDataSourceSdwanServiceRoutingBGPProfileParcel(t *testing.T) {
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.as_override", "false"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.allowas_in_number", "1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_max_number_of_prefixes", "2000"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_threshold", "75"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address", "2001::1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.description", "neighbor2"))
Expand Down Expand Up @@ -165,9 +165,9 @@ func testAccDataSourceSdwanServiceRoutingBGPProfileParcelConfig() string {
config += ` allowas_in_number = 1` + "\n"
config += ` address_families = [{` + "\n"
config += ` family_type = "ipv4-unicast"` + "\n"
config += ` max_number_of_prefixes = 2000` + "\n"
config += ` threshold = 75` + "\n"
config += ` policy_type = "restart"` + "\n"
config += ` restart_max_number_of_prefixes = 2000` + "\n"
config += ` restart_threshold = 75` + "\n"
config += ` restart_interval = 30` + "\n"
config += ` }]` + "\n"
config += ` }]` + "\n"
Expand Down
Loading
Loading