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

Commit 55fba22

Browse files
MGSousanpalm
andauthored
feat: Allow to toggle access to EC2 instance tags (#2592)
* feat: Allow to toggle access to EC2 instance tags * Update variable description Co-authored-by: Niek Palm <[email protected]> * Update variable description Updated description for the metadata_options variable Co-authored-by: Niek Palm <[email protected]> Co-authored-by: Niek Palm <[email protected]>
1 parent 9757716 commit 55fba22

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Diff for: modules/runners/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ yarn run dist
158158
| <a name="input_logging_kms_key_id"></a> [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no |
159159
| <a name="input_logging_retention_in_days"></a> [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 |
160160
| <a name="input_market_options"></a> [market\_options](#input\_market\_options) | DEPCRECATED: Replaced by `instance_target_capacity_type`. | `string` | `null` | no |
161-
| <a name="input_metadata_options"></a> [metadata\_options](#input\_metadata\_options) | Metadata options for the ec2 runner instances. | `map(any)` | <pre>{<br> "http_endpoint": "enabled",<br> "http_put_response_hop_limit": 1,<br> "http_tokens": "optional"<br>}</pre> | no |
161+
| <a name="input_metadata_options"></a> [metadata\_options](#input\_metadata\_options) | Metadata options for the ec2 runner instances. | `map(any)` | <pre>{<br> "http_endpoint": "enabled",<br> "http_put_response_hop_limit": 1,<br> "http_tokens": "optional",<br> "instance_metadata_tags": "enabled"<br>}</pre> | no |
162162
| <a name="input_minimum_running_time_in_minutes"></a> [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 |
163163
| <a name="input_overrides"></a> [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)` | <pre>{<br> "name_runner": "",<br> "name_sg": ""<br>}</pre> | no |
164164
| <a name="input_pool_config"></a> [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. | <pre>list(object({<br> schedule_expression = string<br> size = number<br> }))</pre> | `[]` | no |

Diff for: modules/runners/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ resource "aws_launch_template" "runner" {
8282
http_endpoint = metadata_options.value.http_endpoint
8383
http_tokens = metadata_options.value.http_tokens
8484
http_put_response_hop_limit = metadata_options.value.http_put_response_hop_limit
85-
instance_metadata_tags = "enabled"
85+
instance_metadata_tags = metadata_options.value.instance_metadata_tags
8686
}
8787
}
8888

Diff for: modules/runners/variables.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,10 @@ variable "runner_ec2_tags" {
502502
}
503503

504504
variable "metadata_options" {
505-
description = "Metadata options for the ec2 runner instances."
505+
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."
506506
type = map(any)
507507
default = {
508+
instance_metadata_tags = "enabled"
508509
http_endpoint = "enabled"
509510
http_tokens = "optional"
510511
http_put_response_hop_limit = 1

Diff for: variables.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,10 @@ variable "runner_ec2_tags" {
576576
}
577577

578578
variable "runner_metadata_options" {
579-
description = "Metadata options for the ec2 runner instances."
579+
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."
580580
type = map(any)
581581
default = {
582+
instance_metadata_tags = "enabled"
582583
http_endpoint = "enabled"
583584
http_tokens = "optional"
584585
http_put_response_hop_limit = 1

0 commit comments

Comments
 (0)