Skip to content

Commit

Permalink
fix: remove unused var and add default disk size
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lefevre <lefevre.kevin@gmail.com>
  • Loading branch information
ArchiFleKs committed Dec 8, 2020
1 parent cc82d6f commit cffcf57
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/node_groups/launchtemplate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ data "template_file" "workers_userdata" {
template = file("${path.module}/templates/userdata.sh.tpl")

vars = {
bootstrap_extra_args = each.value["bootstrap_extra_args"]
kubelet_extra_args = each.value["kubelet_extra_args"]
kubelet_extra_args = each.value["kubelet_extra_args"]
}
}

Expand All @@ -16,15 +15,15 @@ data "template_file" "workers_userdata" {
# then the default user-data for bootstrapping a cluster is merged in the copy.
resource "aws_launch_template" "workers" {
for_each = { for k, v in local.node_groups_expanded : k => v if v["create_launch_template"] }
name = lookup(each.value, "name", join("-", [var.cluster_name, each.key, random_pet.node_groups[each.key].id]))
name_prefix = lookup(each.value, "name", join("-", [var.cluster_name, each.key, random_pet.node_groups[each.key].id]))
description = lookup(each.value, "name", join("-", [var.cluster_name, each.key, random_pet.node_groups[each.key].id]))
update_default_version = true

block_device_mappings {
device_name = "/dev/xvda"

ebs {
volume_size = each.value.disk_size
volume_size = lookup(each.value, "disk_size", 20)
volume_type = "gp2"
delete_on_termination = true
# encrypted = true
Expand Down

0 comments on commit cffcf57

Please sign in to comment.