Skip to content

Commit f619eab

Browse files
committed
updates
1 parent 608d7f9 commit f619eab

File tree

12 files changed

+98
-93
lines changed

12 files changed

+98
-93
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.6.3 (unreleased)
22

3-
- Fix type of `interface` attribute of `sdwan_cisco_vpn_feature_template` under `ipv4_static_ipsec_routes` & `ipv4_static_gre_routes`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
3+
- BREAKING CHANGE: `sdwan_cisco_vpn_feature_template`: rename `interface` attribute to `interfaces`
4+
- Fix type of `interfaces` attribute of `sdwan_cisco_vpn_feature_template` under `ipv4_static_ipsec_routes` & `ipv4_static_gre_routes`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
45
- Fix type of `as_path_prepend` attribute of `sdwan_service_route_policy_feature` and `sdwan_transport_route_policy_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
56
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
67

docs/data-sources/cisco_vpn_feature_template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ Read-Only:
103103

104104
Read-Only:
105105

106-
- `interface` (List of String) List of GRE Interfaces
107-
- `interface_variable` (String) Variable name
106+
- `interfaces` (List of String) List of GRE Interfaces
107+
- `interfaces_variable` (String) Variable name
108108
- `optional` (Boolean) Indicates if list item is considered optional.
109109
- `prefix` (String) Prefix
110110
- `prefix_variable` (String) Variable name
@@ -116,8 +116,8 @@ Read-Only:
116116

117117
Read-Only:
118118

119-
- `interface` (List of String) List of IPSEC Interfaces (Separated by commas)
120-
- `interface_variable` (String) Variable name
119+
- `interfaces` (List of String) List of IPSEC Interfaces (Separated by commas)
120+
- `interfaces_variable` (String) Variable name
121121
- `optional` (Boolean) Indicates if list item is considered optional.
122122
- `prefix` (String) Prefix
123123
- `prefix_variable` (String) Variable name

docs/guides/changelog.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
---
2-
subcategory: "Guides"
3-
page_title: "Changelog"
4-
description: |-
5-
Changelog
6-
---
7-
8-
# Changelog
9-
1+
---
2+
subcategory: "Guides"
3+
page_title: "Changelog"
4+
description: |-
5+
Changelog
6+
---
7+
8+
# Changelog
9+
1010
## 0.6.3 (unreleased)
1111

12-
- Fix type of `interface` attribute of `sdwan_cisco_vpn_feature_template` under `ipv4_static_ipsec_routes` & `ipv4_static_gre_routes`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
12+
- BREAKING CHANGE: `sdwan_cisco_vpn_feature_template`: rename `interface` attribute to `interfaces`
13+
- Fix type of `interfaces` attribute of `sdwan_cisco_vpn_feature_template` under `ipv4_static_ipsec_routes` & `ipv4_static_gre_routes`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
1314
- Fix type of `as_path_prepend` attribute of `sdwan_service_route_policy_feature` and `sdwan_transport_route_policy_feature`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/474)
1415
- Add missing options under `unsupported_features` attribute of `sdwan_configuration_group`, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/478)
1516

@@ -453,4 +454,4 @@ description: |-
453454
## 0.1.0 (July 23, 2021)
454455

455456
- Initial Release
456-
457+

docs/resources/cisco_vpn_feature_template.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ resource "sdwan_cisco_vpn_feature_template" "example" {
9797
]
9898
ipv4_static_gre_routes = [
9999
{
100-
prefix = "3.3.3.0/24"
101-
vpn_id = 2
102-
interface = ["e1"]
100+
prefix = "3.3.3.0/24"
101+
vpn_id = 2
102+
interfaces = ["e1"]
103103
}
104104
]
105105
ipv4_static_ipsec_routes = [
106106
{
107-
prefix = "4.4.4.0/24"
108-
vpn_id = 2
109-
interface = ["e1"]
107+
prefix = "4.4.4.0/24"
108+
vpn_id = 2
109+
interfaces = ["e1"]
110110
}
111111
]
112112
omp_advertise_ipv4_routes = [
@@ -328,8 +328,8 @@ Optional:
328328

329329
Optional:
330330

331-
- `interface` (List of String) List of GRE Interfaces
332-
- `interface_variable` (String) Variable name
331+
- `interfaces` (List of String) List of GRE Interfaces
332+
- `interfaces_variable` (String) Variable name
333333
- `optional` (Boolean) Indicates if list item is considered optional.
334334
- `prefix` (String) Prefix
335335
- `prefix_variable` (String) Variable name
@@ -342,8 +342,8 @@ Optional:
342342

343343
Optional:
344344

345-
- `interface` (List of String) List of IPSEC Interfaces (Separated by commas)
346-
- `interface_variable` (String) Variable name
345+
- `interfaces` (List of String) List of IPSEC Interfaces (Separated by commas)
346+
- `interfaces_variable` (String) Variable name
347347
- `optional` (Boolean) Indicates if list item is considered optional.
348348
- `prefix` (String) Prefix
349349
- `prefix_variable` (String) Variable name

examples/resources/sdwan_cisco_vpn_feature_template/resource.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ resource "sdwan_cisco_vpn_feature_template" "example" {
8080
]
8181
ipv4_static_gre_routes = [
8282
{
83-
prefix = "3.3.3.0/24"
84-
vpn_id = 2
85-
interface = ["e1"]
83+
prefix = "3.3.3.0/24"
84+
vpn_id = 2
85+
interfaces = ["e1"]
8686
}
8787
]
8888
ipv4_static_ipsec_routes = [
8989
{
90-
prefix = "4.4.4.0/24"
91-
vpn_id = 2
92-
interface = ["e1"]
90+
prefix = "4.4.4.0/24"
91+
vpn_id = 2
92+
interfaces = ["e1"]
9393
}
9494
]
9595
omp_advertise_ipv4_routes = [

gen/definitions/feature_templates/cisco_vpn.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ attributes:
134134
tf_name: vpn_id
135135
example: 2
136136
- model_name: interface
137+
tf_name: interfaces
137138
type: List
138139
example: e1
139140
- model_name: ipsec-route
@@ -145,6 +146,7 @@ attributes:
145146
tf_name: vpn_id
146147
example: 2
147148
- model_name: interface
149+
tf_name: interfaces
148150
type: List
149151
example: e1
150152
- model_name: advertise

internal/provider/data_source_sdwan_cisco_vpn_feature_template.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,12 @@ func (d *CiscoVPNFeatureTemplateDataSource) Schema(ctx context.Context, req data
488488
MarkdownDescription: "Destination VPN to resolve the prefix",
489489
Computed: true,
490490
},
491-
"interface": schema.ListAttribute{
491+
"interfaces": schema.ListAttribute{
492492
MarkdownDescription: "List of GRE Interfaces",
493493
ElementType: types.StringType,
494494
Computed: true,
495495
},
496-
"interface_variable": schema.StringAttribute{
496+
"interfaces_variable": schema.StringAttribute{
497497
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
498498
Computed: true,
499499
},
@@ -521,12 +521,12 @@ func (d *CiscoVPNFeatureTemplateDataSource) Schema(ctx context.Context, req data
521521
MarkdownDescription: "Destination VPN to resolve the prefix",
522522
Computed: true,
523523
},
524-
"interface": schema.ListAttribute{
524+
"interfaces": schema.ListAttribute{
525525
MarkdownDescription: "List of IPSEC Interfaces (Separated by commas)",
526526
ElementType: types.StringType,
527527
Computed: true,
528528
},
529-
"interface_variable": schema.StringAttribute{
529+
"interfaces_variable": schema.StringAttribute{
530530
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
531531
Computed: true,
532532
},

internal/provider/data_source_sdwan_cisco_vpn_feature_template_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ func testAccDataSourceSdwanCiscoVPNFeatureTemplateConfig() string {
197197
config += ` ipv4_static_gre_routes = [{` + "\n"
198198
config += ` prefix = "3.3.3.0/24"` + "\n"
199199
config += ` vpn_id = 2` + "\n"
200-
config += ` interface = ["e1"]` + "\n"
200+
config += ` interfaces = ["e1"]` + "\n"
201201
config += ` }]` + "\n"
202202
config += ` ipv4_static_ipsec_routes = [{` + "\n"
203203
config += ` prefix = "4.4.4.0/24"` + "\n"
204204
config += ` vpn_id = 2` + "\n"
205-
config += ` interface = ["e1"]` + "\n"
205+
config += ` interfaces = ["e1"]` + "\n"
206206
config += ` }]` + "\n"
207207
config += ` omp_advertise_ipv4_routes = [{` + "\n"
208208
config += ` protocol = "bgp"` + "\n"

internal/provider/model_sdwan_cisco_vpn_feature_template.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,21 @@ type CiscoVPNIpv6StaticRoutes struct {
142142
}
143143

144144
type CiscoVPNIpv4StaticGreRoutes struct {
145-
Optional types.Bool `tfsdk:"optional"`
146-
Prefix types.String `tfsdk:"prefix"`
147-
PrefixVariable types.String `tfsdk:"prefix_variable"`
148-
VpnId types.Int64 `tfsdk:"vpn_id"`
149-
Interface types.List `tfsdk:"interface"`
150-
InterfaceVariable types.String `tfsdk:"interface_variable"`
145+
Optional types.Bool `tfsdk:"optional"`
146+
Prefix types.String `tfsdk:"prefix"`
147+
PrefixVariable types.String `tfsdk:"prefix_variable"`
148+
VpnId types.Int64 `tfsdk:"vpn_id"`
149+
Interfaces types.List `tfsdk:"interfaces"`
150+
InterfacesVariable types.String `tfsdk:"interfaces_variable"`
151151
}
152152

153153
type CiscoVPNIpv4StaticIpsecRoutes struct {
154-
Optional types.Bool `tfsdk:"optional"`
155-
Prefix types.String `tfsdk:"prefix"`
156-
PrefixVariable types.String `tfsdk:"prefix_variable"`
157-
VpnId types.Int64 `tfsdk:"vpn_id"`
158-
Interface types.List `tfsdk:"interface"`
159-
InterfaceVariable types.String `tfsdk:"interface_variable"`
154+
Optional types.Bool `tfsdk:"optional"`
155+
Prefix types.String `tfsdk:"prefix"`
156+
PrefixVariable types.String `tfsdk:"prefix_variable"`
157+
VpnId types.Int64 `tfsdk:"vpn_id"`
158+
Interfaces types.List `tfsdk:"interfaces"`
159+
InterfacesVariable types.String `tfsdk:"interfaces_variable"`
160160
}
161161

162162
type CiscoVPNOmpAdvertiseIpv4Routes struct {
@@ -1017,18 +1017,18 @@ func (data CiscoVPN) toBody(ctx context.Context) string {
10171017
}
10181018
itemAttributes = append(itemAttributes, "interface")
10191019

1020-
if !item.InterfaceVariable.IsNull() {
1020+
if !item.InterfacesVariable.IsNull() {
10211021
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10221022
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "variableName")
1023-
itemBody, _ = sjson.Set(itemBody, "interface."+"vipVariableName", item.InterfaceVariable.ValueString())
1024-
} else if item.Interface.IsNull() {
1023+
itemBody, _ = sjson.Set(itemBody, "interface."+"vipVariableName", item.InterfacesVariable.ValueString())
1024+
} else if item.Interfaces.IsNull() {
10251025
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10261026
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "ignore")
10271027
} else {
10281028
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10291029
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "constant")
10301030
var values []string
1031-
item.Interface.ElementsAs(ctx, &values, false)
1031+
item.Interfaces.ElementsAs(ctx, &values, false)
10321032
itemBody, _ = sjson.Set(itemBody, "interface."+"vipValue", values)
10331033
}
10341034
if !item.Optional.IsNull() {
@@ -1072,18 +1072,18 @@ func (data CiscoVPN) toBody(ctx context.Context) string {
10721072
}
10731073
itemAttributes = append(itemAttributes, "interface")
10741074

1075-
if !item.InterfaceVariable.IsNull() {
1075+
if !item.InterfacesVariable.IsNull() {
10761076
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10771077
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "variableName")
1078-
itemBody, _ = sjson.Set(itemBody, "interface."+"vipVariableName", item.InterfaceVariable.ValueString())
1079-
} else if item.Interface.IsNull() {
1078+
itemBody, _ = sjson.Set(itemBody, "interface."+"vipVariableName", item.InterfacesVariable.ValueString())
1079+
} else if item.Interfaces.IsNull() {
10801080
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10811081
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "ignore")
10821082
} else {
10831083
itemBody, _ = sjson.Set(itemBody, "interface."+"vipObjectType", "list")
10841084
itemBody, _ = sjson.Set(itemBody, "interface."+"vipType", "constant")
10851085
var values []string
1086-
item.Interface.ElementsAs(ctx, &values, false)
1086+
item.Interfaces.ElementsAs(ctx, &values, false)
10871087
itemBody, _ = sjson.Set(itemBody, "interface."+"vipValue", values)
10881088
}
10891089
if !item.Optional.IsNull() {
@@ -2989,22 +2989,22 @@ func (data *CiscoVPN) fromBody(ctx context.Context, res gjson.Result) {
29892989
}
29902990
if cValue := v.Get("interface.vipType"); len(cValue.Array()) > 0 {
29912991
if cValue.String() == "variableName" {
2992-
item.Interface = types.ListNull(types.StringType)
2992+
item.Interfaces = types.ListNull(types.StringType)
29932993

29942994
cv := v.Get("interface.vipVariableName")
2995-
item.InterfaceVariable = types.StringValue(cv.String())
2995+
item.InterfacesVariable = types.StringValue(cv.String())
29962996

29972997
} else if cValue.String() == "ignore" {
2998-
item.Interface = types.ListNull(types.StringType)
2999-
item.InterfaceVariable = types.StringNull()
2998+
item.Interfaces = types.ListNull(types.StringType)
2999+
item.InterfacesVariable = types.StringNull()
30003000
} else if cValue.String() == "constant" {
30013001
cv := v.Get("interface.vipValue")
3002-
item.Interface = helpers.GetStringList(cv.Array())
3003-
item.InterfaceVariable = types.StringNull()
3002+
item.Interfaces = helpers.GetStringList(cv.Array())
3003+
item.InterfacesVariable = types.StringNull()
30043004
}
30053005
} else {
3006-
item.Interface = types.ListNull(types.StringType)
3007-
item.InterfaceVariable = types.StringNull()
3006+
item.Interfaces = types.ListNull(types.StringType)
3007+
item.InterfacesVariable = types.StringNull()
30083008
}
30093009
data.Ipv4StaticGreRoutes = append(data.Ipv4StaticGreRoutes, item)
30103010
return true
@@ -3060,22 +3060,22 @@ func (data *CiscoVPN) fromBody(ctx context.Context, res gjson.Result) {
30603060
}
30613061
if cValue := v.Get("interface.vipType"); len(cValue.Array()) > 0 {
30623062
if cValue.String() == "variableName" {
3063-
item.Interface = types.ListNull(types.StringType)
3063+
item.Interfaces = types.ListNull(types.StringType)
30643064

30653065
cv := v.Get("interface.vipVariableName")
3066-
item.InterfaceVariable = types.StringValue(cv.String())
3066+
item.InterfacesVariable = types.StringValue(cv.String())
30673067

30683068
} else if cValue.String() == "ignore" {
3069-
item.Interface = types.ListNull(types.StringType)
3070-
item.InterfaceVariable = types.StringNull()
3069+
item.Interfaces = types.ListNull(types.StringType)
3070+
item.InterfacesVariable = types.StringNull()
30713071
} else if cValue.String() == "constant" {
30723072
cv := v.Get("interface.vipValue")
3073-
item.Interface = helpers.GetStringList(cv.Array())
3074-
item.InterfaceVariable = types.StringNull()
3073+
item.Interfaces = helpers.GetStringList(cv.Array())
3074+
item.InterfacesVariable = types.StringNull()
30753075
}
30763076
} else {
3077-
item.Interface = types.ListNull(types.StringType)
3078-
item.InterfaceVariable = types.StringNull()
3077+
item.Interfaces = types.ListNull(types.StringType)
3078+
item.InterfacesVariable = types.StringNull()
30793079
}
30803080
data.Ipv4StaticIpsecRoutes = append(data.Ipv4StaticIpsecRoutes, item)
30813081
return true
@@ -4565,7 +4565,7 @@ func (data *CiscoVPN) hasChanges(ctx context.Context, state *CiscoVPN) bool {
45654565
if !data.Ipv4StaticGreRoutes[i].VpnId.Equal(state.Ipv4StaticGreRoutes[i].VpnId) {
45664566
hasChanges = true
45674567
}
4568-
if !data.Ipv4StaticGreRoutes[i].Interface.Equal(state.Ipv4StaticGreRoutes[i].Interface) {
4568+
if !data.Ipv4StaticGreRoutes[i].Interfaces.Equal(state.Ipv4StaticGreRoutes[i].Interfaces) {
45694569
hasChanges = true
45704570
}
45714571
}
@@ -4580,7 +4580,7 @@ func (data *CiscoVPN) hasChanges(ctx context.Context, state *CiscoVPN) bool {
45804580
if !data.Ipv4StaticIpsecRoutes[i].VpnId.Equal(state.Ipv4StaticIpsecRoutes[i].VpnId) {
45814581
hasChanges = true
45824582
}
4583-
if !data.Ipv4StaticIpsecRoutes[i].Interface.Equal(state.Ipv4StaticIpsecRoutes[i].Interface) {
4583+
if !data.Ipv4StaticIpsecRoutes[i].Interfaces.Equal(state.Ipv4StaticIpsecRoutes[i].Interfaces) {
45844584
hasChanges = true
45854585
}
45864586
}

internal/provider/resource_sdwan_cisco_vpn_feature_template.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,12 @@ func (r *CiscoVPNFeatureTemplateResource) Schema(ctx context.Context, req resour
540540
MarkdownDescription: helpers.NewAttributeDescription("Destination VPN to resolve the prefix").AddDefaultValueDescription("0").String,
541541
Optional: true,
542542
},
543-
"interface": schema.ListAttribute{
543+
"interfaces": schema.ListAttribute{
544544
MarkdownDescription: helpers.NewAttributeDescription("List of GRE Interfaces").String,
545545
ElementType: types.StringType,
546546
Optional: true,
547547
},
548-
"interface_variable": schema.StringAttribute{
548+
"interfaces_variable": schema.StringAttribute{
549549
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
550550
Optional: true,
551551
},
@@ -573,12 +573,12 @@ func (r *CiscoVPNFeatureTemplateResource) Schema(ctx context.Context, req resour
573573
MarkdownDescription: helpers.NewAttributeDescription("Destination VPN to resolve the prefix").AddDefaultValueDescription("0").String,
574574
Optional: true,
575575
},
576-
"interface": schema.ListAttribute{
576+
"interfaces": schema.ListAttribute{
577577
MarkdownDescription: helpers.NewAttributeDescription("List of IPSEC Interfaces (Separated by commas)").String,
578578
ElementType: types.StringType,
579579
Optional: true,
580580
},
581-
"interface_variable": schema.StringAttribute{
581+
"interfaces_variable": schema.StringAttribute{
582582
MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
583583
Optional: true,
584584
},

0 commit comments

Comments
 (0)