diff --git a/modules/runners/README.md b/modules/runners/README.md index 8f3b51b1f3..b2e8fd0a55 100644 --- a/modules/runners/README.md +++ b/modules/runners/README.md @@ -158,7 +158,7 @@ yarn run dist | [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no | | [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `180` | no | | [market\_options](#input\_market\_options) | DEPCRECATED: Replaced by `instance_target_capacity_type`. | `string` | `null` | no | -| [metadata\_options](#input\_metadata\_options) | Metadata options for the ec2 runner instances. | `map(any)` |
{| no | +| [metadata\_options](#input\_metadata\_options) | Metadata options for the ec2 runner instances. | `map(any)` |
"http_endpoint": "enabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional"
}
{| no | | [minimum\_running\_time\_in\_minutes](#input\_minimum\_running\_time\_in\_minutes) | The time an ec2 action runner should be running at minimum before terminated if non busy. If not set the default is calculated based on the OS. | `number` | `null` | no | | [overrides](#input\_overrides) | This map provides the possibility to override some defaults. The following attributes are supported: `name_sg` overrides the `Name` tag for all security groups created by this module. `name_runner_agent_instance` overrides the `Name` tag for the ec2 instance defined in the auto launch configuration. `name_docker_machine_runners` overrides the `Name` tag spot instances created by the runner agent. | `map(string)` |
"http_endpoint": "enabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional",
"instance_metadata_tags": "enabled"
}
{| no | | [pool\_config](#input\_pool\_config) | The configuration for updating the pool. The `pool_size` to adjust to by the events triggered by the `schedule_expression`. For example you can configure a cron expression for week days to adjust the pool to 10 and another expression for the weekend to adjust the pool to 1. |
"name_runner": "",
"name_sg": ""
}
list(object({| `[]` | no | diff --git a/modules/runners/main.tf b/modules/runners/main.tf index 9bbfe2f35c..d2330eaf63 100644 --- a/modules/runners/main.tf +++ b/modules/runners/main.tf @@ -82,7 +82,7 @@ resource "aws_launch_template" "runner" { http_endpoint = metadata_options.value.http_endpoint http_tokens = metadata_options.value.http_tokens http_put_response_hop_limit = metadata_options.value.http_put_response_hop_limit - instance_metadata_tags = "enabled" + instance_metadata_tags = metadata_options.value.instance_metadata_tags } } diff --git a/modules/runners/variables.tf b/modules/runners/variables.tf index 54b6706da6..082433f7f1 100644 --- a/modules/runners/variables.tf +++ b/modules/runners/variables.tf @@ -496,9 +496,10 @@ variable "runner_ec2_tags" { } variable "metadata_options" { - description = "Metadata options for the ec2 runner instances." + description = "Metadata options for the ec2 runner instances. By default, the module uses metadata tags for bootstrapping the runner, only disable `instance_metadata_tags` when using custom scripts for starting the runner." type = map(any) default = { + instance_metadata_tags = "enabled" http_endpoint = "enabled" http_tokens = "optional" http_put_response_hop_limit = 1 diff --git a/variables.tf b/variables.tf index 4e5db061cf..8604199e00 100644 --- a/variables.tf +++ b/variables.tf @@ -568,9 +568,10 @@ variable "runner_ec2_tags" { } variable "runner_metadata_options" { - description = "Metadata options for the ec2 runner instances." + description = "Metadata options for the ec2 runner instances. By default, the module uses metadata tags for bootstrapping the runner, only disable `instance_metadata_tags` when using custom scripts for starting the runner." type = map(any) default = { + instance_metadata_tags = "enabled" http_endpoint = "enabled" http_tokens = "optional" http_put_response_hop_limit = 1
schedule_expression = string
size = number
}))