Skip to content

Commit

Permalink
update metadata_options (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohanyadav authored Dec 13, 2024
1 parent 0e84758 commit d432cd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module "opszero-eks" {
nodes_max_size = 3,
nodes_min_size = 3
ami_type = "CUSTOM"
node_disk_encrypted = true
},
"t3a-medium-spot2" = {
instance_types = [
Expand All @@ -82,6 +83,7 @@ module "opszero-eks" {
node_desired_capacity = 1,
nodes_max_size = 1,
nodes_min_size = 1
node_disk_encrypted = true
}
}

Expand Down
7 changes: 4 additions & 3 deletions node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ module "eks_mng_bottlerocket_custom_ami" {
}

resource "aws_launch_template" "encrypted_launch_template" {
for_each = var.node_groups != null ? { for k, v in var.node_groups : k => v if lookup(v, "node_disk_encrypted", false) == true } : {}
for_each = { for k, v in var.node_groups : k => v if lookup(v, "node_disk_encrypted", false) }

name_prefix = "${var.environment_name}-${each.key}"
image_id = data.aws_ssm_parameter.bottlerocket_ami.value
user_data = module.eks_mng_bottlerocket_custom_ami.user_data

metadata_options {
http_endpoint = "enabled"
http_tokens = "required"
http_endpoint = "enabled"
http_tokens = "required"
http_put_response_hop_limit = 5
}

monitoring {
Expand Down

0 comments on commit d432cd9

Please sign in to comment.