diff --git a/CHANGELOG.md b/CHANGELOG.md index 618d1603..9e59f854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.2.11 (unreleased) - Fix idempotency issue with various resource and boolean values +- Remove redundant `per_tunnel_qos` and `per_tunnel_qos_aggregator` attributes from `sdwan_cisco_vpn_interface_feature_template` resource and data source ## 0.2.10 diff --git a/docs/data-sources/cisco_vpn_interface_feature_template.md b/docs/data-sources/cisco_vpn_interface_feature_template.md index 81cb228b..5b236efd 100644 --- a/docs/data-sources/cisco_vpn_interface_feature_template.md +++ b/docs/data-sources/cisco_vpn_interface_feature_template.md @@ -109,10 +109,6 @@ data "sdwan_cisco_vpn_interface_feature_template" "example" { - `nat_pool_range_start_variable` (String) Variable name - `nat_type` (String) NAT type - `nat_type_variable` (String) Variable name -- `per_tunnel_qos` (Boolean) Per-tunnel Qos -- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator -- `per_tunnel_qos_aggregator_variable` (String) Variable name -- `per_tunnel_qos_variable` (String) Variable name - `poe` (Boolean) Configure interface as Power-over-Ethernet source - `poe_variable` (String) Variable name - `propagate_sgt` (Boolean) Enable/Disable CTS SGT propagation on an interface. diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index c69ecb46..7fba1bde 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -7,6 +7,11 @@ description: |- # Changelog +## 0.2.11 (unreleased) + +- Fix idempotency issue with various resource and boolean values +- Remove redundant `per_tunnel_qos` and `per_tunnel_qos_aggregator` attributes from `sdwan_cisco_vpn_interface_feature_template` resource and data source + ## 0.2.10 - Fix issue with `sdwan_cisco_ospf_feature_template` resource when not configuring route policies diff --git a/docs/resources/cisco_vpn_interface_feature_template.md b/docs/resources/cisco_vpn_interface_feature_template.md index 3fe1630b..bc95d896 100644 --- a/docs/resources/cisco_vpn_interface_feature_template.md +++ b/docs/resources/cisco_vpn_interface_feature_template.md @@ -102,8 +102,6 @@ resource "sdwan_cisco_vpn_interface_feature_template" "example" { } ] tunnel_interface_border = false - per_tunnel_qos = false - per_tunnel_qos_aggregator = false tunnel_qos_mode = "spoke" tunnel_bandwidth = 50 tunnel_interface_groups = [5] @@ -352,12 +350,6 @@ resource "sdwan_cisco_vpn_interface_feature_template" "example" { - Choices: `interface`, `pool`, `loopback` - Default value: `interface` - `nat_type_variable` (String) Variable name -- `per_tunnel_qos` (Boolean) Per-tunnel Qos - - Default value: `false` -- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator - - Default value: `false` -- `per_tunnel_qos_aggregator_variable` (String) Variable name -- `per_tunnel_qos_variable` (String) Variable name - `poe` (Boolean) Configure interface as Power-over-Ethernet source - Default value: `false` - `poe_variable` (String) Variable name diff --git a/examples/resources/sdwan_cisco_vpn_interface_feature_template/resource.tf b/examples/resources/sdwan_cisco_vpn_interface_feature_template/resource.tf index 92fdf3e0..2b6d3be4 100644 --- a/examples/resources/sdwan_cisco_vpn_interface_feature_template/resource.tf +++ b/examples/resources/sdwan_cisco_vpn_interface_feature_template/resource.tf @@ -85,8 +85,6 @@ resource "sdwan_cisco_vpn_interface_feature_template" "example" { } ] tunnel_interface_border = false - per_tunnel_qos = false - per_tunnel_qos_aggregator = false tunnel_qos_mode = "spoke" tunnel_bandwidth = 50 tunnel_interface_groups = [5] diff --git a/gen/definitions/feature_templates/cisco_ospf.yaml b/gen/definitions/feature_templates/cisco_ospf.yaml index 7da1123a..4d1ec69d 100644 --- a/gen/definitions/feature_templates/cisco_ospf.yaml +++ b/gen/definitions/feature_templates/cisco_ospf.yaml @@ -16,12 +16,15 @@ attributes: example: true - model_name: always tf_name: default_information_originate_always + exclude_ignore: true example: true - model_name: metric tf_name: default_information_originate_metric + exclude_ignore: true example: 100 - model_name: metric-type tf_name: default_information_originate_metric_type + exclude_ignore: true example: type1 - model_name: external tf_name: distance_external diff --git a/gen/definitions/feature_templates/cisco_vpn_interface.yaml b/gen/definitions/feature_templates/cisco_vpn_interface.yaml index 06e449a8..eb2f1a20 100644 --- a/gen/definitions/feature_templates/cisco_vpn_interface.yaml +++ b/gen/definitions/feature_templates/cisco_vpn_interface.yaml @@ -175,12 +175,9 @@ attributes: tf_name: tunnel_interface_border exclude_ignore: true example: false - - model_name: per-tunnel-qos - example: false - - model_name: per-tunnel-qos-aggregator - example: false - model_name: mode tf_name: tunnel_qos_mode + exclude_ignore: true example: spoke - model_name: tunnels-bandwidth tf_name: tunnel_bandwidth @@ -358,24 +355,31 @@ attributes: example: false - model_name: period tf_name: qos_adaptive_period + exclude_ignore: true example: 15 - model_name: bandwidth-down tf_name: qos_adaptive_bandwidth_downstream + exclude_ignore: true example: 10000 - model_name: dmin tf_name: qos_adaptive_min_downstream + exclude_ignore: true example: 100 - model_name: dmax tf_name: qos_adaptive_max_downstream + exclude_ignore: true example: 100000 - model_name: bandwidth-up tf_name: qos_adaptive_bandwidth_upstream + exclude_ignore: true example: 10000 - model_name: umin tf_name: qos_adaptive_min_upstream + exclude_ignore: true example: 100 - model_name: umax tf_name: qos_adaptive_max_upstream + exclude_ignore: true example: 100000 - model_name: shaping-rate example: 1000 diff --git a/gen/generator.go b/gen/generator.go index e8bc1cef..ff8254d0 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -399,7 +399,7 @@ func parseFeatureTemplateAttribute(attr *YamlConfigAttribute, model gjson.Result variable = true } } - if !ignore && r.Get("objectType").String() != "tree" { + if !ignore && r.Get("objectType").String() != "tree" && !attr.ExcludeIgnore { attr.Mandatory = true } if variable && r.Get("objectType").String() != "tree" && !attr.NodeOnlyContainer { diff --git a/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template.go b/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template.go index ad9dd2a3..d6f44619 100644 --- a/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template.go +++ b/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template.go @@ -571,22 +571,6 @@ func (d *CiscoVPNInterfaceFeatureTemplateDataSource) Schema(ctx context.Context, MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, - "per_tunnel_qos": schema.BoolAttribute{ - MarkdownDescription: "Per-tunnel Qos", - Computed: true, - }, - "per_tunnel_qos_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Computed: true, - }, - "per_tunnel_qos_aggregator": schema.BoolAttribute{ - MarkdownDescription: "Per-tunnel QoS Aggregator", - Computed: true, - }, - "per_tunnel_qos_aggregator_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Computed: true, - }, "tunnel_qos_mode": schema.StringAttribute{ MarkdownDescription: "Set tunnel QoS mode", Computed: true, diff --git a/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template_test.go b/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template_test.go index 22076cfb..0efc4394 100644 --- a/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template_test.go +++ b/internal/provider/data_source_sdwan_cisco_vpn_interface_feature_template_test.go @@ -82,8 +82,6 @@ func TestAccDataSourceSdwanCiscoVPNInterfaceFeatureTemplate(t *testing.T) { resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_encapsulations.0.preference", "10"), resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_encapsulations.0.weight", "100"), resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_border", "false"), - resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos", "false"), - resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos_aggregator", "false"), resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_qos_mode", "spoke"), resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_bandwidth", "50"), resource.TestCheckResourceAttr("data.sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_color", "gold"), @@ -256,8 +254,6 @@ resource "sdwan_cisco_vpn_interface_feature_template" "test" { weight = 100 }] tunnel_interface_border = false - per_tunnel_qos = false - per_tunnel_qos_aggregator = false tunnel_qos_mode = "spoke" tunnel_bandwidth = 50 tunnel_interface_groups = [5] diff --git a/internal/provider/model_sdwan_cisco_ospf_feature_template.go b/internal/provider/model_sdwan_cisco_ospf_feature_template.go index 5a4be1fc..5c7c8840 100644 --- a/internal/provider/model_sdwan_cisco_ospf_feature_template.go +++ b/internal/provider/model_sdwan_cisco_ospf_feature_template.go @@ -210,8 +210,6 @@ func (data CiscoOSPF) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipType", "variableName") body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipVariableName", data.DefaultInformationOriginateAlwaysVariable.ValueString()) } else if data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipObjectType", "node-only") - body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipType", "ignore") } else { body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipObjectType", "node-only") body, _ = sjson.Set(body, path+"ospf.default-information.originate.always."+"vipType", "constant") @@ -223,8 +221,6 @@ func (data CiscoOSPF) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipType", "variableName") body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipVariableName", data.DefaultInformationOriginateMetricVariable.ValueString()) } else if data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipType", "ignore") } else { body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric."+"vipType", "constant") @@ -236,8 +232,6 @@ func (data CiscoOSPF) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipType", "variableName") body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipVariableName", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) } else if data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipType", "ignore") } else { body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"ospf.default-information.originate.metric-type."+"vipType", "constant") diff --git a/internal/provider/model_sdwan_cisco_vpn_interface_feature_template.go b/internal/provider/model_sdwan_cisco_vpn_interface_feature_template.go index 1218a7c9..147a17c7 100644 --- a/internal/provider/model_sdwan_cisco_vpn_interface_feature_template.go +++ b/internal/provider/model_sdwan_cisco_vpn_interface_feature_template.go @@ -97,10 +97,6 @@ type CiscoVPNInterface struct { TunnelInterfaceEncapsulations []CiscoVPNInterfaceTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"` TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"` TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"` - PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"` - PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"` - PerTunnelQosAggregator types.Bool `tfsdk:"per_tunnel_qos_aggregator"` - PerTunnelQosAggregatorVariable types.String `tfsdk:"per_tunnel_qos_aggregator_variable"` TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"` TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"` TunnelBandwidth types.Int64 `tfsdk:"tunnel_bandwidth"` @@ -1169,34 +1165,11 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnel-interface.border."+"vipValue", strconv.FormatBool(data.TunnelInterfaceBorder.ValueBool())) } - if !data.PerTunnelQosVariable.IsNull() { - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipType", "variableName") - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipVariableName", data.PerTunnelQosVariable.ValueString()) - } else if data.PerTunnelQos.IsNull() { - } else { - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipType", "constant") - body, _ = sjson.Set(body, path+"per-tunnel-qos."+"vipValue", strconv.FormatBool(data.PerTunnelQos.ValueBool())) - } - - if !data.PerTunnelQosAggregatorVariable.IsNull() { - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipType", "variableName") - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipVariableName", data.PerTunnelQosAggregatorVariable.ValueString()) - } else if data.PerTunnelQosAggregator.IsNull() { - } else { - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipType", "constant") - body, _ = sjson.Set(body, path+"per-tunnel-qos-aggregator."+"vipValue", strconv.FormatBool(data.PerTunnelQosAggregator.ValueBool())) - } - if !data.TunnelQosModeVariable.IsNull() { body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos.mode."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos.mode."+"vipType", "variableName") body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos.mode."+"vipVariableName", data.TunnelQosModeVariable.ValueString()) } else if data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos.mode."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"tunnel-interface.tunnel-qos.mode."+"vipType", "constant") @@ -1802,8 +1775,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipVariableName", data.QosAdaptivePeriodVariable.ValueString()) } else if data.QosAdaptivePeriod.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipObjectType", "object") - body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipType", "ignore") } else { body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.period."+"vipType", "constant") @@ -1815,7 +1786,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.bandwidth-down."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.bandwidth-down."+"vipVariableName", data.QosAdaptiveBandwidthDownstreamVariable.ValueString()) } else if data.QosAdaptiveBandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.downstream", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.bandwidth-down."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.bandwidth-down."+"vipType", "constant") @@ -1827,7 +1797,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmin."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmin."+"vipVariableName", data.QosAdaptiveMinDownstreamVariable.ValueString()) } else if data.QosAdaptiveMinDownstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmin."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmin."+"vipType", "constant") @@ -1839,7 +1808,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmax."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmax."+"vipVariableName", data.QosAdaptiveMaxDownstreamVariable.ValueString()) } else if data.QosAdaptiveMaxDownstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmax."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.downstream.range.dmax."+"vipType", "constant") @@ -1851,7 +1819,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.bandwidth-up."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.bandwidth-up."+"vipVariableName", data.QosAdaptiveBandwidthUpstreamVariable.ValueString()) } else if data.QosAdaptiveBandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.upstream", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.bandwidth-up."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.bandwidth-up."+"vipType", "constant") @@ -1863,7 +1830,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umin."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umin."+"vipVariableName", data.QosAdaptiveMinUpstreamVariable.ValueString()) } else if data.QosAdaptiveMinUpstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umin."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umin."+"vipType", "constant") @@ -1875,7 +1841,6 @@ func (data CiscoVPNInterface) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umax."+"vipType", "variableName") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umax."+"vipVariableName", data.QosAdaptiveMaxUpstreamVariable.ValueString()) } else if data.QosAdaptiveMaxUpstream.IsNull() { - body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range", map[string]interface{}{}) } else { body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umax."+"vipObjectType", "object") body, _ = sjson.Set(body, path+"qos-adaptive.upstream.range.umax."+"vipType", "constant") @@ -3543,44 +3508,6 @@ func (data *CiscoVPNInterface) fromBody(ctx context.Context, res gjson.Result) { data.TunnelInterfaceBorder = types.BoolNull() data.TunnelInterfaceBorderVariable = types.StringNull() } - if value := res.Get(path + "per-tunnel-qos.vipType"); value.Exists() { - if value.String() == "variableName" { - data.PerTunnelQos = types.BoolNull() - - v := res.Get(path + "per-tunnel-qos.vipVariableName") - data.PerTunnelQosVariable = types.StringValue(v.String()) - - } else if value.String() == "ignore" { - data.PerTunnelQos = types.BoolNull() - data.PerTunnelQosVariable = types.StringNull() - } else if value.String() == "constant" { - v := res.Get(path + "per-tunnel-qos.vipValue") - data.PerTunnelQos = types.BoolValue(v.Bool()) - data.PerTunnelQosVariable = types.StringNull() - } - } else { - data.PerTunnelQos = types.BoolNull() - data.PerTunnelQosVariable = types.StringNull() - } - if value := res.Get(path + "per-tunnel-qos-aggregator.vipType"); value.Exists() { - if value.String() == "variableName" { - data.PerTunnelQosAggregator = types.BoolNull() - - v := res.Get(path + "per-tunnel-qos-aggregator.vipVariableName") - data.PerTunnelQosAggregatorVariable = types.StringValue(v.String()) - - } else if value.String() == "ignore" { - data.PerTunnelQosAggregator = types.BoolNull() - data.PerTunnelQosAggregatorVariable = types.StringNull() - } else if value.String() == "constant" { - v := res.Get(path + "per-tunnel-qos-aggregator.vipValue") - data.PerTunnelQosAggregator = types.BoolValue(v.Bool()) - data.PerTunnelQosAggregatorVariable = types.StringNull() - } - } else { - data.PerTunnelQosAggregator = types.BoolNull() - data.PerTunnelQosAggregatorVariable = types.StringNull() - } if value := res.Get(path + "tunnel-interface.tunnel-qos.mode.vipType"); value.Exists() { if value.String() == "variableName" { data.TunnelQosMode = types.StringNull() @@ -5658,12 +5585,6 @@ func (data *CiscoVPNInterface) hasChanges(ctx context.Context, state *CiscoVPNIn if !data.TunnelInterfaceBorder.Equal(state.TunnelInterfaceBorder) { hasChanges = true } - if !data.PerTunnelQos.Equal(state.PerTunnelQos) { - hasChanges = true - } - if !data.PerTunnelQosAggregator.Equal(state.PerTunnelQosAggregator) { - hasChanges = true - } if !data.TunnelQosMode.Equal(state.TunnelQosMode) { hasChanges = true } diff --git a/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template.go b/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template.go index 7962308f..3d5cfdee 100644 --- a/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template.go +++ b/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template.go @@ -647,22 +647,6 @@ func (r *CiscoVPNInterfaceFeatureTemplateResource) Schema(ctx context.Context, r MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, - "per_tunnel_qos": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String, - Optional: true, - }, - "per_tunnel_qos_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Optional: true, - }, - "per_tunnel_qos_aggregator": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel QoS Aggregator").AddDefaultValueDescription("false").String, - Optional: true, - }, - "per_tunnel_qos_aggregator_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Optional: true, - }, "tunnel_qos_mode": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("hub", "spoke").String, Optional: true, diff --git a/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template_test.go b/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template_test.go index d43ed274..c706dfae 100644 --- a/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template_test.go +++ b/internal/provider/resource_sdwan_cisco_vpn_interface_feature_template_test.go @@ -34,20 +34,6 @@ func TestAccSdwanCiscoVPNInterfaceFeatureTemplate(t *testing.T) { Config: testAccSdwanCiscoVPNInterfaceFeatureTemplateConfig_minimum(), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "interface_name", "ge0/0"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "nat_type", "interface"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "nat_pool_range_start", "10.1.1.1"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "nat_pool_range_end", "10.1.1.255"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "nat_pool_prefix_length", "24"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos", "false"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos_aggregator", "false"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_qos_mode", "spoke"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_bandwidth", "50"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_bandwidth_downstream", "10000"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_min_downstream", "100"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_max_downstream", "100000"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_bandwidth_upstream", "10000"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_min_upstream", "100"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "qos_adaptive_max_upstream", "100000"), ), }, { @@ -102,8 +88,6 @@ func TestAccSdwanCiscoVPNInterfaceFeatureTemplate(t *testing.T) { resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_encapsulations.0.preference", "10"), resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_encapsulations.0.weight", "100"), resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_border", "false"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos", "false"), - resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "per_tunnel_qos_aggregator", "false"), resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_qos_mode", "spoke"), resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_bandwidth", "50"), resource.TestCheckResourceAttr("sdwan_cisco_vpn_interface_feature_template.test", "tunnel_interface_color", "gold"), @@ -210,20 +194,6 @@ func testAccSdwanCiscoVPNInterfaceFeatureTemplateConfig_minimum() string { description = "Terraform integration test" device_types = ["vedge-C8000V"] interface_name = "ge0/0" - nat_type = "interface" - nat_pool_range_start = "10.1.1.1" - nat_pool_range_end = "10.1.1.255" - nat_pool_prefix_length = 24 - per_tunnel_qos = false - per_tunnel_qos_aggregator = false - tunnel_qos_mode = "spoke" - tunnel_bandwidth = 50 - qos_adaptive_bandwidth_downstream = 10000 - qos_adaptive_min_downstream = 100 - qos_adaptive_max_downstream = 100000 - qos_adaptive_bandwidth_upstream = 10000 - qos_adaptive_min_upstream = 100 - qos_adaptive_max_upstream = 100000 } ` } @@ -301,8 +271,6 @@ func testAccSdwanCiscoVPNInterfaceFeatureTemplateConfig_all() string { weight = 100 }] tunnel_interface_border = false - per_tunnel_qos = false - per_tunnel_qos_aggregator = false tunnel_qos_mode = "spoke" tunnel_bandwidth = 50 tunnel_interface_groups = [5] diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index c69ecb46..7fba1bde 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -7,6 +7,11 @@ description: |- # Changelog +## 0.2.11 (unreleased) + +- Fix idempotency issue with various resource and boolean values +- Remove redundant `per_tunnel_qos` and `per_tunnel_qos_aggregator` attributes from `sdwan_cisco_vpn_interface_feature_template` resource and data source + ## 0.2.10 - Fix issue with `sdwan_cisco_ospf_feature_template` resource when not configuring route policies