From a2a201267593b555576c071b27429ea7a39e437a Mon Sep 17 00:00:00 2001 From: Momir Nikolic Date: Wed, 21 Jul 2021 14:33:04 +0200 Subject: [PATCH 1/4] Parametrize runner instance launch configuration metadata options --- main.tf | 4 ++++ variables.tf | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/main.tf b/main.tf index 493b16e4c..3060ac0b1 100644 --- a/main.tf +++ b/main.tf @@ -226,6 +226,10 @@ resource "aws_launch_configuration" "gitlab_runner_instance" { iops = lookup(root_block_device.value, "iops", null) } } + metadata_options { + http_endpoint = var.runner_instance_metadata_options_http_endpoint + http_tokens = var.runner_instance_metadata_options_http_tokens + } associate_public_ip_address = false == var.runners_use_private_address diff --git a/variables.tf b/variables.tf index df36d6f43..b7e193b24 100644 --- a/variables.tf +++ b/variables.tf @@ -65,6 +65,18 @@ variable "runner_instance_spot_price" { default = null } +variable "runner_instance_metadata_options_http_endpoint" { + description = "Enable the Gitlab runner instance metadata service. The allowed values are enabled, disabled." + type = string + default = "enabled" +} + +variable "runner_instance_metadata_options_http_tokens" { + description = "Set if Gitlab runner instance metadata service session tokens are required. The allowed values are optional, required." + type = string + default = "optional" +} + variable "ssh_key_pair" { description = "Set this to use existing AWS key pair" type = string From 72d6637706e91488c83873e84bcbb81390c1a0c5 Mon Sep 17 00:00:00 2001 From: Momir Nikolic Date: Wed, 21 Jul 2021 15:38:07 +0200 Subject: [PATCH 2/4] Parametrize runner instance launch configuration metadata options --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 3060ac0b1..ac841c06e 100644 --- a/main.tf +++ b/main.tf @@ -227,8 +227,8 @@ resource "aws_launch_configuration" "gitlab_runner_instance" { } } metadata_options { - http_endpoint = var.runner_instance_metadata_options_http_endpoint - http_tokens = var.runner_instance_metadata_options_http_tokens + http_endpoint = var.runner_instance_metadata_options_http_endpoint + http_tokens = var.runner_instance_metadata_options_http_tokens } associate_public_ip_address = false == var.runners_use_private_address From f0cf92546608900ecbd7f2e7f339d0b35e838f6a Mon Sep 17 00:00:00 2001 From: momirnikolic <31136128+momirnikolic@users.noreply.github.com> Date: Thu, 22 Jul 2021 10:49:29 +0200 Subject: [PATCH 3/4] Update variables.tf Co-authored-by: Niek Palm --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index b7e193b24..4bb05f5e6 100644 --- a/variables.tf +++ b/variables.tf @@ -66,7 +66,7 @@ variable "runner_instance_spot_price" { } variable "runner_instance_metadata_options_http_endpoint" { - description = "Enable the Gitlab runner instance metadata service. The allowed values are enabled, disabled." + description = "Enable the Gitlab runner agent instance metadata service. The allowed values are enabled, disabled." type = string default = "enabled" } From 17ce9d1aaea5e7b0ed344ea5f0aa0cf85e52e6e6 Mon Sep 17 00:00:00 2001 From: momirnikolic <31136128+momirnikolic@users.noreply.github.com> Date: Thu, 22 Jul 2021 10:49:35 +0200 Subject: [PATCH 4/4] Update variables.tf Co-authored-by: Niek Palm --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 4bb05f5e6..a3a416c13 100644 --- a/variables.tf +++ b/variables.tf @@ -72,7 +72,7 @@ variable "runner_instance_metadata_options_http_endpoint" { } variable "runner_instance_metadata_options_http_tokens" { - description = "Set if Gitlab runner instance metadata service session tokens are required. The allowed values are optional, required." + description = "Set if Gitlab runner agent instance metadata service session tokens are required. The allowed values are optional, required." type = string default = "optional" }