Skip to content

Commit

Permalink
feat: make http_put_response_hop_limit configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Jun 20, 2024
1 parent 76a668e commit 4b35674
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/nomad-clients/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "aws_instance" "nomad_client" {

metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_put_response_hop_limit = var.http_put_response_hop_limit
instance_metadata_tags = "enabled"
}

Expand Down
3 changes: 2 additions & 1 deletion modules/nomad-clients/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ resource "aws_launch_template" "nomad_client" {

metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_put_response_hop_limit = var.http_put_response_hop_limit
instance_metadata_tags = "enabled"
}

block_device_mappings {
device_name = "/dev/sda1"

Expand Down
12 changes: 9 additions & 3 deletions modules/nomad-clients/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ variable "nomad_client_exec_host_volumes" {

variable "extra_script" {
description = "Path to custom script to be run as part of cloud-init"
type = string
default = ""
}
type = string
default = ""
}

variable "http_put_response_hop_limit" {
description = "The hop limit for HTTP PUT response for the EC2 instance metadata service"
type = number
default = 2
}
2 changes: 1 addition & 1 deletion modules/nomad-servers/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "aws_launch_template" "nomad_server" {

metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_put_response_hop_limit = var.http_put_response_hop_limit
instance_metadata_tags = "enabled"
}

Expand Down
12 changes: 9 additions & 3 deletions modules/nomad-servers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ variable "nomad_file_limit" {

variable "extra_script" {
description = "Path to custom script to be run as part of cloud-init"
type = string
default = ""
}
type = string
default = ""
}

variable "http_put_response_hop_limit" {
description = "The hop limit for HTTP PUT response for the EC2 instance metadata service"
type = number
default = 2
}

0 comments on commit 4b35674

Please sign in to comment.