Skip to content

Commit 7a06162

Browse files
authored
feat: set asn and routing type as optional for edge clusters (#297)
Sets `asn` and `routing_type` as optional inputs for edge clusters. Signed-off-by: Stoyan Zhelyazkov <[email protected]>
1 parent c5eec72 commit 7a06162

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

docs/resources/edge_cluster.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Review the documentation for VMware Cloud Foundation for more information about
3232
### Required
3333

3434
- `admin_password` (String) Administrator password for the NSX manager
35-
- `asn` (String) ASN for the cluster
3635
- `audit_password` (String) Audit user password for the NSX manager
3736
- `edge_node` (Block List, Min: 1) The nodes in the edge cluster (see [below for nested schema](#nestedblock--edge_node))
3837
- `form_factor` (String) One among: XLARGE, LARGE, MEDIUM, SMALL
@@ -41,13 +40,15 @@ Review the documentation for VMware Cloud Foundation for more information about
4140
- `name` (String) The name of the edge cluster
4241
- `profile_type` (String) One among: DEFAULT, CUSTOM. If set to CUSTOM a 'profile' must be provided
4342
- `root_password` (String) Root user password for the NSX manager
44-
- `routing_type` (String) One among: EBGP, STATIC
4543

4644
### Optional
4745

46+
- `asn` (String) ASN for the cluster
4847
- `internal_transit_subnets` (List of String) Subnet addresses in CIDR notation that are used to assign addresses to logical links connecting service routers and distributed routers
4948
- `profile` (Block List, Max: 1) The specification for the edge cluster profile (see [below for nested schema](#nestedblock--profile))
49+
- `routing_type` (String) One among: EBGP, STATIC
5050
- `skip_tep_routability_check` (Boolean) Set to true to bypass normal ICMP-based check of Edge TEP / host TEP routability (default is false, meaning do check)
51+
- `tier0_name` (String) Name for the Tier-0 gateway
5152
- `tier1_name` (String) Name for the Tier-1 gateway
5253
- `tier1_unhosted` (Boolean) Select whether Tier-1 being created per this spec is hosted on the new Edge cluster or not (default value is false, meaning hosted)
5354
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

internal/provider/resource_edge_cluster.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func ResourceEdgeCluster() *schema.Resource {
9090
},
9191
"routing_type": {
9292
Type: schema.TypeString,
93-
Required: true,
93+
Optional: true,
9494
Description: "One among: EBGP, STATIC",
9595
ValidateFunc: validation.StringInSlice([]string{"EBGP", "STATIC"}, false),
9696
},
@@ -114,7 +114,7 @@ func ResourceEdgeCluster() *schema.Resource {
114114
},
115115
"asn": {
116116
Type: schema.TypeString,
117-
Required: true,
117+
Optional: true,
118118
Description: "ASN for the cluster",
119119
ValidateFunc: validationUtils.ValidASN,
120120
},

internal/provider/resource_edge_cluster_test.go

-6
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ func getEdgeClusterConfigFullInitial() string {
7777
audit_password = %q
7878
form_factor = "MEDIUM"
7979
profile_type = "DEFAULT"
80-
routing_type = "EBGP"
8180
high_availability = "ACTIVE_ACTIVE"
8281
mtu = 8940
83-
asn = "65004"
8482
%s
8583
%s
8684
}
@@ -122,14 +120,10 @@ func getEdgeClusterConfigFullExpansion() string {
122120
root_password = %q
123121
admin_password = %q
124122
audit_password = %q
125-
tier0_name = "T0_testCluster1"
126-
tier1_name = "T1_testCluster1"
127123
form_factor = "MEDIUM"
128124
profile_type = "DEFAULT"
129-
routing_type = "EBGP"
130125
high_availability = "ACTIVE_ACTIVE"
131126
mtu = 8940
132-
asn = "65004"
133127
%s
134128
%s
135129
%s

0 commit comments

Comments
 (0)