Skip to content

Commit c3e91a4

Browse files
committed
Make documentation less confusing
1 parent bc4481c commit c3e91a4

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

modules/node_groups/README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
1010

1111
`iam_role_arn` must be specified in either `var.node_groups_defaults` or `var.node_groups` if the default parent IAM role is not being created for whatever reason, for example if `manage_worker_iam_resources` is set to false in the parent.
1212

13+
## `node_groups` and `node_groups_defaults` keys
14+
`node_groups_defaults` is a map that can take the below keys. Values will be used if not specified in individual node groups.
15+
16+
`node_groups` is a map of maps. Key of first level will be used as unique value for `for_each` resources and in the `aws_eks_node_group` name. Inner map can take the below values.
17+
18+
| Name | Description | Type | If unset |
19+
|------|-------------|:----:|:-----:|
20+
| additional\_tags | Additional tags to apply to node group | map(string) | Only `var.tags` applied |
21+
| ami\_release\_version | AMI version of workers | string | Provider default behavior |
22+
| ami\_type | AMI Type. See Terraform or AWS docs | string | Provider default behavior |
23+
| desired\_capacity | Desired number of workers | number | `var.workers_group_defaults[asg_desired_capacity]` |
24+
| disk\_size | Workers' disk size | number | Provider default behavior |
25+
| iam\_role\_arn | IAM role ARN for workers | string | `var.default_iam_role_arn` |
26+
| instance\_type | Workers' instance type | string | `var.workers_group_defaults[instance_type]` |
27+
| k8s\_labels | Kubernetes labels | map(string) | No labels applied |
28+
| key\_name | Key name for workers. Set to empty string to disable remote access | string | `var.workers_group_defaults[key_name]` |
29+
| max\_capacity | Max number of workers | number | `var.workers_group_defaults[asg_max_size]` |
30+
| min\_capacity | Min number of workers | number | `var.workers_group_defaults[asg_min_size]` |
31+
| source\_security\_group\_ids | Source security groups for remote access to workers | list(string) | If key\_name is specified: THE REMOTE ACCESS WILL BE OPENED TO THE WORLD |
32+
| subnets | Subnets to contain workers | list(string) | `var.workers_group_defaults[subnets]` |
33+
1334
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1435
## Inputs
1536

@@ -20,7 +41,7 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
2041
| create\_eks | Controls if EKS resources should be created (it affects almost all resources) | bool | `"true"` | no |
2142
| default\_iam\_role\_arn | ARN of the default IAM worker role to use if one is not specified in the node_groups | string | n/a | yes |
2243
| node\_groups | Map of maps of `eks_node_groups` to create. See `node_groups_defaults` for valid keys and types. | any | `{}` | no |
23-
| node\_groups\_defaults | map of maps of node groups to create. See default for valid keys and type. See source for extra comments | any | `{ "additional_tags": [ { "key": "" } ], "ami_release_version": "", "ami_type": "", "desired_capacity": 0, "disk_size": 0, "iam_role_arn": "", "instance_type": "", "k8s_labels": [ { "key": "" } ], "key_name": "", "max_capacity": 0, "min_capacity": 0, "source_security_group_ids": [ "" ], "subnets": [ "" ] }` | no |
44+
| node\_groups\_defaults | map of maps of node groups to create. See default for valid keys and type. See source for extra comments | any | n/a | yes |
2445
| tags | A map of tags to add to all resources | map(string) | n/a | yes |
2546
| workers\_group\_defaults | Workers group defaults from parent | any | n/a | yes |
2647

modules/node_groups/variables.tf

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,6 @@ variable "tags" {
3232
variable "node_groups_defaults" {
3333
description = "map of maps of node groups to create. See default for valid keys and type. See source for extra comments"
3434
type = any
35-
36-
# This will be always be overriden by the value from the top level module
37-
default = {
38-
iam_role_arn = "" # IAM Role ARN for workers. If unset: uses `var.default_iam_role_arn`
39-
subnets = [""] # Subnets to contain workers. If unset: uses `var.workers_group_defaults[subnets]`
40-
desired_capacity = 0 # Desired number of workers. If unset: uses `var.workers_group_defaults[asg_desired_capacity]`
41-
max_capacity = 0 # Max number of workers. If unset: uses `var.workers_group_defaults[asg_max_size]`
42-
min_capacity = 0 # Min number of workers. If unset: uses `var.workers_group_defaults[asg_min_size]`
43-
ami_type = "" # AMI type. See Terraform docs. If unset: falls back to provider default behavior
44-
disk_size = 0 # Workers' disk size. If unset: falls back to provider default behavior
45-
instance_type = "" # Workers' instance type. If unset: uses `var.workers_group_defaults[instance_type]`
46-
k8s_labels = { key = "" } # Map of Kubernetes labels. If unset: no extra labels set
47-
ami_release_version = "" # AMI version of workers. If unset: falls back to provider default behavior
48-
key_name = "" # Key name for workers. Set to empty string to disable remote access. If unset: uses `var.workers_group_defaults[key_name]`
49-
source_security_group_ids = [""] # List of source security groups for remote access to workers. If unset and key_name is specified: THE REMOTE ACCESS PORT WILL BE OPENED TO THE WORLD
50-
additional_tags = { key = "" } # Additional tags to apply to node_group. If unset: only `var.tags` applied
51-
}
5235
}
5336

5437
variable "node_groups" {

0 commit comments

Comments
 (0)