Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Allow configuring the metadata options in launch configuration #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/nomad-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ resource "aws_launch_configuration" "launch_configuration" {
delete_on_termination = var.root_volume_delete_on_termination
}

metadata_options {
http_endpoint = var.launch_configuration_metadata_endpoint ? "enabled": "disabled"
http_put_response_hop_limit = var.launch_configuration_metadata_response_hop_limit
http_tokens = var.launch_configuration_metadata_http_tokens
}

dynamic "ebs_block_device" {
for_each = var.ebs_block_devices

Expand Down
18 changes: 18 additions & 0 deletions modules/nomad-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,21 @@ variable "iam_permissions_boundary" {
type = string
default = null
}

variable "launch_configuration_metadata_http_tokens" {
default = "optional"
validation {
condition = var.launch_configuration_metadata_http_tokens == "optional" || var.launch_configuration_metadata_http_tokens == "required"
error_message = "The supported values for launch_configuration_metadata_http_tokens are either optional or required."
}
}

variable "launch_configuration_metadata_response_hop_limit" {
default = 1
type = number
}

variable "launch_configuration_metadata_endpoint" {
default = true
type = bool
}