Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
- BREAKING CHANGE: Rename `target_interface` attribute of `sdwan_application_priority_qos_policy` resource to `target_interfaces`
- BREAKING CHANGE: Adds `ipv4_configuration_type` and `ipv6_configuration_type` to `sdwan_service_lan_vpn_interface_ethernet_feature` resource
- Add `community` support to the `sdwan_route_policy_definition` resource and data source
- Fix problem where `sdwan_cisco_secure_internet_gateway` resource fails to be deployed to a device during device template push, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/202)
- Fix problem where `sdwan_cedge_pim_feature_template` resource fails to be deployed to a device during device template push, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/534)
- BREAKING CHANGE: Fix type of `imcp_unreachable_allow`, `session_reclassify_allow`, and `unified_logging` in `sdwan_security_policy` resource and data source
- BREAKING CHANGE: Fix type of `max_incomplete_icmp_limit`, `max_incomplete_tcp_limit`, and `max_incomplete_upd_limit` in `sdwan_security_policy` resource and data source
- BREAKING CHANGE: Converts `source_zone` and `destination_zone` fields to `entries` list containing `source_zone`/`destination_zone` objects to support multiple entries in `sdwan_security_policy` resource and data source
Expand Down
22 changes: 12 additions & 10 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
---
subcategory: "Guides"
page_title: "Changelog"
description: |-
Changelog
---

# Changelog

---
subcategory: "Guides"
page_title: "Changelog"
description: |-
Changelog
---
# Changelog
## 0.7.2 (unreleased)

- BREAKING CHANGE: Fix type of `port` attribute of `sdwan_port_list_policy_object` to support multiple values, [Link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/460)
- BREAKING CHANGE: Rename `target_interface` attribute of `sdwan_application_priority_qos_policy` resource to `target_interfaces`
- BREAKING CHANGE: Adds `ipv4_configuration_type` and `ipv6_configuration_type` to `sdwan_service_lan_vpn_interface_ethernet_feature` resource
- Add `community` support to the `sdwan_route_policy_definition` resource and data source
- Fix problem where `sdwan_cisco_secure_internet_gateway` resource fails to be deployed to a device during device template push, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/202)
- Fix problem where `sdwan_cedge_pim_feature_template` resource fails to be deployed to a device during device template push, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/534)
- BREAKING CHANGE: Fix type of `imcp_unreachable_allow`, `session_reclassify_allow`, and `unified_logging` in `sdwan_security_policy` resource and data source
- BREAKING CHANGE: Fix type of `max_incomplete_icmp_limit`, `max_incomplete_tcp_limit`, and `max_incomplete_upd_limit` in `sdwan_security_policy` resource and data source
- BREAKING CHANGE: Converts `source_zone` and `destination_zone` fields to `entries` list containing `source_zone`/`destination_zone` objects to support multiple entries in `sdwan_security_policy` resource and data source
Expand Down Expand Up @@ -489,4 +491,4 @@ description: |-
## 0.1.0 (July 23, 2021)

- Initial Release

2 changes: 1 addition & 1 deletion docs/resources/cedge_pim_feature_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ resource "sdwan_cedge_pim_feature_template" "example" {
default = true
rp_addresses = [
{
ip_address = "1.2.3.4"
access_list = "99"
ip_address = "1.2.3.4"
override = false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ resource "sdwan_cisco_secure_internet_gateway_feature_template" "example" {
interface_pairs = [
{
active_interface = "e1"
active_interface_weight = 10
backup_interface = "e2"
active_interface_weight = 10
backup_interface_weight = 20
}
]
Expand Down Expand Up @@ -92,12 +92,12 @@ resource "sdwan_cisco_secure_internet_gateway_feature_template" "example" {
tracker_source_ip = "2.3.4.5"
trackers = [
{
tracker_type = "SIG"
name = "TRACKER1"
endpoint_api_url = "https://1.1.1.1"
threshold = 500
interval = 60
multiplier = 4
tracker_type = "SIG"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ resource "sdwan_cedge_pim_feature_template" "example" {
default = true
rp_addresses = [
{
ip_address = "1.2.3.4"
access_list = "99"
ip_address = "1.2.3.4"
override = false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ resource "sdwan_cisco_secure_internet_gateway_feature_template" "example" {
interface_pairs = [
{
active_interface = "e1"
active_interface_weight = 10
backup_interface = "e2"
active_interface_weight = 10
backup_interface_weight = 20
}
]
Expand Down Expand Up @@ -75,12 +75,12 @@ resource "sdwan_cisco_secure_internet_gateway_feature_template" "example" {
tracker_source_ip = "2.3.4.5"
trackers = [
{
tracker_type = "SIG"
name = "TRACKER1"
endpoint_api_url = "https://1.1.1.1"
threshold = 500
interval = 60
multiplier = 4
tracker_type = "SIG"
}
]
}
5 changes: 3 additions & 2 deletions gen/definitions/feature_templates/cedge_pim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ attributes:
example: true
- model_name: rp-addr
tf_name: rp_addresses
priority_order_always: true
attributes:
- model_name: access-list
example: 99
- model_name: address
tf_name: ip_address
example: 1.2.3.4
- model_name: access-list
example: 99
- model_name: override
example: false
- model_name: spt-threshold
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# Manual resource - toBody is manually configured to support 'notIgnore' values for 'shutdown' and 'mtu' attributes.
name: Cisco Secure Internet Gateway
minimum_version: 15.0.0
attributes:
Expand Down Expand Up @@ -57,7 +58,6 @@ attributes:
- model_name: pre-shared-secret
tf_name: ike_pre_shared_key
example: A1234567
exclude_ignore: true
- model_name: ike-rekey-interval
example: 600
exclude_ignore: true
Expand All @@ -74,11 +74,9 @@ attributes:
- model_name: ike-local-id
tf_name: ike_pre_shared_key_local_id
example: 1.2.3.4
exclude_ignore: true
- model_name: ike-remote-id
tf_name: ike_pre_shared_key_remote_id
example: 2.3.4.5
exclude_ignore: true
- model_name: ipsec-rekey-interval
example: 7200
exclude_ignore: true
Expand All @@ -101,6 +99,7 @@ attributes:
example: 5.5.5.5
- model_name: service
tf_name: services
priority_order_always: true
attributes:
- model_name: svc-type
tf_name: service_type
Expand All @@ -111,11 +110,11 @@ attributes:
- model_name: active-interface
ignore_enum: true
example: e1
- model_name: active-interface-weight
example: 10
- model_name: backup-interface
ignore_enum: true
example: e2
- model_name: active-interface-weight
example: 10
- model_name: backup-interface-weight
example: 20
- model_name: auth-required
Expand Down Expand Up @@ -202,7 +201,10 @@ attributes:
example: 2.3.4.5
- model_name: tracker
tf_name: trackers
priority_order_always: true
attributes:
- model_name: tracker-type
example: SIG
- model_name: name
example: TRACKER1
- model_name: endpoint-api-url
Expand All @@ -213,5 +215,3 @@ attributes:
example: 60
- model_name: multiplier
example: 4
- model_name: tracker-type
example: SIG
1 change: 1 addition & 0 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ type YamlConfigAttribute struct {
RequiresConstAndVar bool `yaml:"requires_const_and_var"`
RequiresReplace bool `yaml:"requires_replace"`
DynamicDefault bool `yaml:"dynamic_default"`
PriorityOrderAlways bool `yaml:"priority_order_always"`
}

type YamlConfigConditionalAttribute struct {
Expand Down
1 change: 1 addition & 0 deletions gen/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ attribute:
requires_const_and_var: bool(required=False) # If true will include both constant and variable values in payload
requires_replace: bool(required=False) # If true resource will be recreated when attribute is changed
dynamic_default: bool(required=False) # If true when the provided value matches the default value `optionType` will be set to `default` rather than `global`
priority_order_always: bool(required=False) # If true will always set priority-order in feature template payload

conditional_attribute:
name: str() # Reference to other attribute
Expand Down
12 changes: 12 additions & 0 deletions gen/templates/feature_templates/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,26 +534,38 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
}
{{- end}}
{{- end}}
{{- if .PriorityOrderAlways}}
itemChildChildBody, _ = sjson.Set(itemChildChildBody, "priority-order", itemChildChildAttributes)
{{- else}}
if !childChildItem.Optional.IsNull() {
itemChildChildBody, _ = sjson.Set(itemChildChildBody, "vipOptional", childChildItem.Optional.ValueBool())
itemChildChildBody, _ = sjson.Set(itemChildChildBody, "priority-order", itemChildChildAttributes)
}
{{- end}}
itemChildBody, _ = sjson.SetRaw(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}."+"vipValue.-1", itemChildChildBody)
}
{{- end}}
{{- end}}
{{- if .PriorityOrderAlways}}
itemChildBody, _ = sjson.Set(itemChildBody, "priority-order", itemChildAttributes)
{{- else}}
if !childItem.Optional.IsNull() {
itemChildBody, _ = sjson.Set(itemChildBody, "vipOptional", childItem.Optional.ValueBool())
itemChildBody, _ = sjson.Set(itemChildBody, "priority-order", itemChildAttributes)
}
{{- end}}
itemBody, _ = sjson.SetRaw(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}."+"vipValue.-1", itemChildBody)
}
{{- end}}
{{- end}}
{{- if .PriorityOrderAlways}}
itemBody, _ = sjson.Set(itemBody, "priority-order", itemAttributes)
{{- else}}
if !item.Optional.IsNull() {
itemBody, _ = sjson.Set(itemBody, "vipOptional", item.Optional.ValueBool())
itemBody, _ = sjson.Set(itemBody, "priority-order", itemAttributes)
}
{{- end}}
body, _ = sjson.SetRaw(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}."+"vipValue.-1", itemBody)
}
{{- end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,19 +238,19 @@ func (d *CEdgePIMFeatureTemplateDataSource) Schema(ctx context.Context, req data
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"ip_address": schema.StringAttribute{
MarkdownDescription: "Set Static RP IP Address",
"access_list": schema.StringAttribute{
MarkdownDescription: "Set Static RP Access List",
Computed: true,
},
"ip_address_variable": schema.StringAttribute{
"access_list_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"access_list": schema.StringAttribute{
MarkdownDescription: "Set Static RP Access List",
"ip_address": schema.StringAttribute{
MarkdownDescription: "Set Static RP IP Address",
Computed: true,
},
"access_list_variable": schema.StringAttribute{
"ip_address_variable": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func TestAccDataSourceSdwanCEdgePIMFeatureTemplate(t *testing.T) {
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "scope", "1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "range", "16"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "default", "true"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "rp_addresses.0.ip_address", "1.2.3.4"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "rp_addresses.0.access_list", "99"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "rp_addresses.0.ip_address", "1.2.3.4"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "rp_addresses.0.override", "false"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "spt_threshold", "0"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cedge_pim_feature_template.test", "interfaces.0.interface_name", "Ethernet1"))
Expand Down Expand Up @@ -91,8 +91,8 @@ func testAccDataSourceSdwanCEdgePIMFeatureTemplateConfig() string {
config += ` range = "16"` + "\n"
config += ` default = true` + "\n"
config += ` rp_addresses = [{` + "\n"
config += ` ip_address = "1.2.3.4"` + "\n"
config += ` access_list = "99"` + "\n"
config += ` ip_address = "1.2.3.4"` + "\n"
config += ` override = false` + "\n"
config += ` }]` + "\n"
config += ` spt_threshold = "0"` + "\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@ func (d *CiscoSecureInternetGatewayFeatureTemplateDataSource) Schema(ctx context
MarkdownDescription: "Active Tunnel Interface for SIG",
Computed: true,
},
"active_interface_weight": schema.Int64Attribute{
MarkdownDescription: "Active Tunnel Interface Weight",
Computed: true,
},
"backup_interface": schema.StringAttribute{
MarkdownDescription: "Backup Tunnel Interface for SIG",
Computed: true,
},
"active_interface_weight": schema.Int64Attribute{
MarkdownDescription: "Active Tunnel Interface Weight",
Computed: true,
},
"backup_interface_weight": schema.Int64Attribute{
MarkdownDescription: "Backup Tunnel Interface Weight",
Computed: true,
Expand Down Expand Up @@ -482,6 +482,10 @@ func (d *CiscoSecureInternetGatewayFeatureTemplateDataSource) Schema(ctx context
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"tracker_type": schema.StringAttribute{
MarkdownDescription: "",
Computed: true,
},
"name": schema.StringAttribute{
MarkdownDescription: "Tracker name",
Computed: true,
Expand Down Expand Up @@ -522,10 +526,6 @@ func (d *CiscoSecureInternetGatewayFeatureTemplateDataSource) Schema(ctx context
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
Computed: true,
},
"tracker_type": schema.StringAttribute{
MarkdownDescription: "",
Computed: true,
},
"optional": schema.BoolAttribute{
MarkdownDescription: "Indicates if list item is considered optional.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func TestAccDataSourceSdwanCiscoSecureInternetGatewayFeatureTemplate(t *testing.
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "interfaces.0.tunnel_public_ip", "5.5.5.5"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.service_type", "sig"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.interface_pairs.0.active_interface", "e1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.interface_pairs.0.active_interface_weight", "10"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.interface_pairs.0.backup_interface", "e2"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.interface_pairs.0.active_interface_weight", "10"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.interface_pairs.0.backup_interface_weight", "20"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.zscaler_authentication_required", "true"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.zscaler_xff_forward", "true"))
Expand All @@ -88,12 +88,12 @@ func TestAccDataSourceSdwanCiscoSecureInternetGatewayFeatureTemplate(t *testing.
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.umbrella_primary_data_center", "Auto"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "services.0.umbrella_secondary_data_center", "Auto"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "tracker_source_ip", "2.3.4.5"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.tracker_type", "SIG"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.name", "TRACKER1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.endpoint_api_url", "https://1.1.1.1"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.threshold", "500"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.interval", "60"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.multiplier", "4"))
checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cisco_secure_internet_gateway_feature_template.test", "trackers.0.tracker_type", "SIG"))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Expand Down Expand Up @@ -153,8 +153,8 @@ func testAccDataSourceSdwanCiscoSecureInternetGatewayFeatureTemplateConfig() str
config += ` service_type = "sig"` + "\n"
config += ` interface_pairs = [{` + "\n"
config += ` active_interface = "e1"` + "\n"
config += ` active_interface_weight = 10` + "\n"
config += ` backup_interface = "e2"` + "\n"
config += ` active_interface_weight = 10` + "\n"
config += ` backup_interface_weight = 20` + "\n"
config += ` }]` + "\n"
config += ` zscaler_authentication_required = true` + "\n"
Expand All @@ -180,12 +180,12 @@ func testAccDataSourceSdwanCiscoSecureInternetGatewayFeatureTemplateConfig() str
config += ` }]` + "\n"
config += ` tracker_source_ip = "2.3.4.5"` + "\n"
config += ` trackers = [{` + "\n"
config += ` tracker_type = "SIG"` + "\n"
config += ` name = "TRACKER1"` + "\n"
config += ` endpoint_api_url = "https://1.1.1.1"` + "\n"
config += ` threshold = 500` + "\n"
config += ` interval = 60` + "\n"
config += ` multiplier = 4` + "\n"
config += ` tracker_type = "SIG"` + "\n"
config += ` }]` + "\n"
config += `}` + "\n"

Expand Down
Loading
Loading