Skip to content

Commit

Permalink
feat: Support for encrypted root disk in node_groups
Browse files Browse the repository at this point in the history
  • Loading branch information
alzabo committed Aug 8, 2021
1 parent e6d76d0 commit 94ecce8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/node_groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
| capacity\_type | Type of instance capacity to provision. Options are `ON_DEMAND` and `SPOT` | string | Provider default behavior |
| create_launch_template | Create and use a default launch template | bool | `false` |
| desired\_capacity | Desired number of workers | number | `var.workers_group_defaults[asg_desired_capacity]` |
| disk\_encrypted | Whether the root disk will be encrypyted. Requires `create_launch_template` to be `true` and `disk_kms_key_id` to be set | bool | false |
| disk\_kms\_key\_id | KMS Key used to encrypt the root disk. Requires both `create_launch_template` and `disk_encrypted` to be `true` | string | "" |
| disk\_size | Workers' disk size | number | Provider default behavior |
| disk\_type | Workers' disk type. Require `create_launch_template` to be `true`| number | `gp3` |
| enable_monitoring | Enables/disables detailed monitoring. Require `create_launch_template` to be `true`| bool | `true` |
Expand Down
2 changes: 2 additions & 0 deletions modules/node_groups/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ resource "aws_launch_template" "workers" {
ebs {
volume_size = lookup(each.value, "disk_size", null)
volume_type = lookup(each.value, "disk_type", null)
encrypted = lookup(each.value, "disk_encrypted", null)
kms_key_id = lookup(each.value, "disk_kms_key_id", null)
delete_on_termination = true
}
}
Expand Down
2 changes: 2 additions & 0 deletions modules/node_groups/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locals {
kubelet_extra_args = var.workers_group_defaults["kubelet_extra_args"]
disk_size = var.workers_group_defaults["root_volume_size"]
disk_type = var.workers_group_defaults["root_volume_type"]
disk_encrypted = var.workers_group_defaults["root_encrypted"]
disk_kms_key_id = var.workers_group_defaults["root_kms_key_id"]
enable_monitoring = var.workers_group_defaults["enable_monitoring"]
eni_delete = var.workers_group_defaults["eni_delete"]
public_ip = var.workers_group_defaults["public_ip"]
Expand Down

0 comments on commit 94ecce8

Please sign in to comment.