Skip to content

Commit

Permalink
Parameterize node group inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Meyers committed Feb 29, 2024
1 parent ebfb971 commit 1950b5a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion terraform-unity/modules/terraform-eks-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

| Name | Source | Version |
|------|--------|---------|
| <a name="module_unity-eks"></a> [unity-eks](#module\_unity-eks) | [email protected]:unity-sds/unity-cs-infra.git//terraform-unity-eks_module | 0.1.3 |
| <a name="module_unity-eks"></a> [unity-eks](#module\_unity-eks) | [email protected]:unity-sds/unity-cs-infra.git//terraform-unity-eks_module | 8-launch-template-hop-limit |

## Resources

Expand All @@ -35,6 +35,7 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | n/a | `string` | n/a | yes |
| <a name="input_nodegroups"></a> [nodegroups](#input\_nodegroups) | A map of node group configurations | <pre>map(object({<br> instance_types = list(string)<br> min_size = number<br> max_size = number<br> desired_size = number<br> }))</pre> | <pre>{<br> "defaultGroup": {<br> "desired_size": 1,<br> "instance_types": [<br> "m5.xlarge"<br> ],<br> "max_size": 1,<br> "min_size": 1<br> }<br>}</pre> | no |

## Outputs

Expand Down
12 changes: 3 additions & 9 deletions terraform-unity/modules/terraform-eks-cluster/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
module "unity-eks" {
source = "[email protected]:unity-sds/unity-cs-infra.git//terraform-unity-eks_module?ref=0.1.3"
source = "[email protected]:unity-sds/unity-cs-infra.git//terraform-unity-eks_module?ref=8-launch-template-hop-limit"
deployment_name = var.cluster_name

nodegroups = {
defaultGroup = {
instance_types = ["m5.xlarge"]
min_size = 1
max_size = 1
desired_size = 1
}
}
nodegroups = var.nodegroups

aws_auth_roles = [{
rolearn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/mcp-tenantOperator"
username = "admin"
Expand Down
18 changes: 18 additions & 0 deletions terraform-unity/modules/terraform-eks-cluster/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
variable "cluster_name" {
type = string
}

variable "nodegroups" {
description = "A map of node group configurations"
type = map(object({
instance_types = list(string)
min_size = number
max_size = number
desired_size = number
}))
default = {
defaultGroup = {
instance_types = ["m5.xlarge"]
min_size = 1
max_size = 1
desired_size = 1
}
}
}

0 comments on commit 1950b5a

Please sign in to comment.