Skip to content
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

Relax Edge Cluster setting restrictions for Tier0/1 routers and ASN #295

Merged
merged 4 commits into from
Mar 7, 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
18 changes: 7 additions & 11 deletions docs/resources/edge_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ Review the documentation for VMware Cloud Foundation for more information about
- `profile_type` (String) One among: DEFAULT, CUSTOM. If set to CUSTOM a 'profile' must be provided
- `root_password` (String) Root user password for the NSX manager
- `routing_type` (String) One among: EBGP, STATIC
- `tier0_name` (String) Name for the Tier-0 gateway

### Optional

- `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

- `profile` (Block List, Max: 1) The specification for the edge cluster profile (see [below for nested schema](#nestedblock--profile))
- `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)
- `tier1_name` (String) Name for the Tier-1 gateway
Expand All @@ -60,7 +58,6 @@ Review the documentation for VMware Cloud Foundation for more information about
- `id` (String) The ID of this resource.

<a id="nestedblock--edge_node"></a>

### Nested Schema for `edge_node`

Required:
Expand All @@ -79,25 +76,23 @@ Required:

Optional:

- `compute_cluster_id` (String) The id of the compute cluster. You cannot specify a value for `compute_cluster_name` if you set this attribute.
- `compute_cluster_name` (String) The name of the compute cluster. You cannot specify a value for `compute_cluster_id` if you set this attribute.

- `compute_cluster_id` (String) The id of the compute cluster
- `compute_cluster_name` (String) The name of the compute cluster
- `first_nsx_vds_uplink` (String) The name of the first NSX-enabled VDS uplink
- `management_network` (Block List, Max: 1) The management network which will be created for this node (see [below for nested schema](#nestedblock--edge_node--management_network))
- `second_nsx_vds_uplink` (String) The name of the second NSX-enabled VDS uplink
- `uplink` (Block List) Specifications of Tier-0 uplinks for the edge node (see [below for nested schema](#nestedblock--edge_node--uplink))

<a id="nestedblock--edge_node--management_network"></a>

### Nested Schema for `edge_node.management_network`

Required:

- `portgroup_name` (String) The name of the portgroup
- `vlan_id` (Number) The VLAN ID for the portgroup

<a id="nestedblock--edge_node--uplink"></a>

<a id="nestedblock--edge_node--uplink"></a>
### Nested Schema for `edge_node.uplink`

Required:
Expand All @@ -107,7 +102,6 @@ Required:
- `vlan` (Number) The VLAN ID for the distributed switch uplink

<a id="nestedblock--edge_node--uplink--bgp_peer"></a>

### Nested Schema for `edge_node.uplink.bgp_peer`

Required:
Expand All @@ -116,8 +110,10 @@ Required:
- `ip` (String) IP address
- `password` (String) Password

<a id="nestedblock--profile"></a>



<a id="nestedblock--profile"></a>
### Nested Schema for `profile`

Required:
Expand All @@ -128,8 +124,8 @@ Required:
- `name` (String) The name of the profile
- `standby_relocation_threshold` (Number) Standby relocation threshold

<a id="nestedblock--timeouts"></a>

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_edge_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func ResourceEdgeCluster() *schema.Resource {
},
"tier0_name": {
Type: schema.TypeString,
Required: true,
Optional: true,
Description: "Name for the Tier-0 gateway",
ValidateFunc: validation.NoZeroValues,
},
Expand Down
2 changes: 0 additions & 2 deletions internal/provider/resource_edge_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ func getEdgeClusterConfigFullInitial() string {
root_password = %q
admin_password = %q
audit_password = %q
tier0_name = "T0_testCluster1"
tier1_name = "T1_testCluster1"
form_factor = "MEDIUM"
profile_type = "DEFAULT"
routing_type = "EBGP"
Expand Down
11 changes: 3 additions & 8 deletions internal/validation/validation_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,20 +315,15 @@ func IsEmpty(object interface{}) bool {
}

func ValidASN(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)

asn, err := strconv.ParseInt(value, 10, 64)
asn, err := strconv.ParseInt(v.(string), 10, 64)
if err != nil {
errors = append(errors, fmt.Errorf("%q (%q) must be a 64-bit integer", k, v))
return
}

isLegacyAsn := func(a int64) bool {
return a == 7224 || a == 9059 || a == 10124 || a == 17493
if asn < 1 || asn > 4294967294 {
errors = append(errors, fmt.Errorf("%q (%q) must be in the range 1 to 4294967294", k, v))
}

if !isLegacyAsn(asn) && ((asn < 64512) || (asn > 65534 && asn < 4200000000) || (asn > 4294967294)) {
errors = append(errors, fmt.Errorf("%q (%q) must be 7224, 9059, 10124 or 17493 or in the range 64512 to 65534 or 4200000000 to 4294967294", k, v))
}
return
}
Loading