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

Commit

Permalink
Allow configuring the metadata options
Browse files Browse the repository at this point in the history
  • Loading branch information
macnibblet committed Oct 22, 2021
1 parent 2ef09ed commit 066de2e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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
}

0 comments on commit 066de2e

Please sign in to comment.