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

Commit 066de2e

Browse files
committed
Allow configuring the metadata options
1 parent 2ef09ed commit 066de2e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

modules/nomad-cluster/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ resource "aws_launch_configuration" "launch_configuration" {
9393
delete_on_termination = var.root_volume_delete_on_termination
9494
}
9595

96+
metadata_options {
97+
http_endpoint = var.launch_configuration_metadata_endpoint ? "enabled": "disabled"
98+
http_put_response_hop_limit = var.launch_configuration_metadata_response_hop_limit
99+
http_tokens = var.launch_configuration_metadata_http_tokens
100+
}
101+
96102
dynamic "ebs_block_device" {
97103
for_each = var.ebs_block_devices
98104

modules/nomad-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,21 @@ variable "iam_permissions_boundary" {
239239
type = string
240240
default = null
241241
}
242+
243+
variable "launch_configuration_metadata_http_tokens" {
244+
default = "optional"
245+
validation {
246+
condition = var.launch_configuration_metadata_http_tokens != "optional" && var.launch_configuration_metadata_http_tokens != "required"
247+
error_message = "The supported values for launch_configuration_metadata_http_tokens are either optional or required."
248+
}
249+
}
250+
251+
variable "launch_configuration_metadata_response_hop_limit" {
252+
default = 1
253+
type = number
254+
}
255+
256+
variable "launch_configuration_metadata_endpoint" {
257+
default = true
258+
type = bool
259+
}

0 commit comments

Comments
 (0)