Skip to content

Commit

Permalink
feat: make use of imdsv2 optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Jun 22, 2024
1 parent db7fb1e commit 6eb4837
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/nomad-clients/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resource "aws_launch_template" "nomad_client" {
user_data = base64encode(data.cloudinit_config.config.rendered)

metadata_options {
http_tokens = var.http_tokens
http_endpoint = "enabled"
http_put_response_hop_limit = var.http_put_response_hop_limit
instance_metadata_tags = "enabled"
Expand Down
6 changes: 6 additions & 0 deletions modules/nomad-clients/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,9 @@ variable "http_put_response_hop_limit" {
type = number
default = 2
}

variable "http_tokens" {
description = "Whether the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2 (IMDSv2). Can be 'optional', 'required', or 'no-preference'."
type = string
default = "no-preference"
}
1 change: 1 addition & 0 deletions modules/nomad-servers/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "aws_launch_template" "nomad_server" {
user_data = base64encode(data.cloudinit_config.config.rendered)

metadata_options {
http_tokens = var.http_tokens
http_endpoint = "enabled"
http_put_response_hop_limit = var.http_put_response_hop_limit
instance_metadata_tags = "enabled"
Expand Down
6 changes: 6 additions & 0 deletions modules/nomad-servers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,9 @@ variable "http_put_response_hop_limit" {
type = number
default = 2
}

variable "http_tokens" {
description = "Whether the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2 (IMDSv2). Can be 'optional', 'required', or 'no-preference'."
type = string
default = "no-preference"
}

0 comments on commit 6eb4837

Please sign in to comment.