Skip to content

Commit

Permalink
PLT-688: configure lb for control plane in AWS cluster.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikchern committed Sep 17, 2023
1 parent b6e1291 commit b9d8e01
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/resources/cluster_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Required:

Optional:

- `control_plane_lb` (String) Control plane load balancer type. Valid values are `Internet-facing` and `internal`. Defaults to `` (empty string).
- `vpc_id` (String)


Expand Down
1 change: 1 addition & 0 deletions docs/resources/virtual_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ resource "spectrocloud_virtual_cluster" "cluster" {
- `cluster_group_uid` (String)
- `cluster_profile` (Block List) (see [below for nested schema](#nestedblock--cluster_profile))
- `cluster_rbac_binding` (Block List) (see [below for nested schema](#nestedblock--cluster_rbac_binding))
- `context` (String)
- `force_delete` (Boolean) If set to `true`, the cluster will be force deleted and user has to manually clean up the provisioned cloud resources.
- `force_delete_delay` (Number) Delay duration in minutes to before invoking cluster force delete. Default and minimum is 20.
- `host_cluster_uid` (String)
Expand Down
15 changes: 12 additions & 3 deletions spectrocloud/resource_cluster_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ func resourceClusterAws() *schema.Resource {
ForceNew: true,
Optional: true,
},
"control_plane_lb": {
Type: schema.TypeString,
ForceNew: true,
Default: "",
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"", "Internet-facing", "internal"}, false),
Description: "Control plane load balancer type. Valid values are `Internet-facing` and `internal`. Defaults to `` (empty string).",
},
},
},
},
Expand Down Expand Up @@ -512,9 +520,10 @@ func toAwsCluster(c *client.V1Client, d *schema.ResourceData) (*models.V1Spectro
Profiles: profiles,
Policies: toPolicies(d),
CloudConfig: &models.V1AwsClusterConfig{
SSHKeyName: cloudConfig["ssh_key_name"].(string),
Region: types.Ptr(cloudConfig["region"].(string)),
VpcID: cloudConfig["vpc_id"].(string),
SSHKeyName: cloudConfig["ssh_key_name"].(string),
Region: types.Ptr(cloudConfig["region"].(string)),
VpcID: cloudConfig["vpc_id"].(string),
ControlPlaneLoadBalancer: cloudConfig["control_plane_lb"].(string),
},
},
}
Expand Down

0 comments on commit b9d8e01

Please sign in to comment.