Skip to content

Commit ecfbed5

Browse files
committed
review
1 parent 6b4ebea commit ecfbed5

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ In case the setup does not work as intended follow the trace of events:
397397
| <a name="input_instance_allocation_strategy"></a> [instance\_allocation\_strategy](#input\_instance\_allocation\_strategy) | The allocation strategy for spot instances. AWS recommends to use `capacity-optimized` however the AWS default is `lowest-price`. | `string` | `"lowest-price"` | no |
398398
| <a name="input_instance_max_spot_price"></a> [instance\_max\_spot\_price](#input\_instance\_max\_spot\_price) | Max price price for spot intances per hour. This variable will be passed to the create fleet as max spot price for the fleet. | `string` | `null` | no |
399399
| <a name="input_instance_profile_path"></a> [instance\_profile\_path](#input\_instance\_profile\_path) | The path that will be added to the instance\_profile, if not set the environment name will be used. | `string` | `null` | no |
400-
| <a name="input_instance_targeet_capacity_type"></a> [instance\_targeet\_capacity\_type](#input\_instance\_targeet\_capacity\_type) | Default lifecyle used runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
400+
| <a name="input_instance_targeet_capacity_type"></a> [instance\_targeet\_capacity\_type](#input\_instance\_targeet\_capacity\_type) | Default lifecycle used for runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
401401
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | [DEPRECATED] See instance\_types. | `string` | `null` | no |
402402
| <a name="input_instance_types"></a> [instance\_types](#input\_instance\_types) | List of instance types for the action runner. Defaults are based on runner\_os (amzn2 for linux and Windows Server Core for win). | `list(string)` | <pre>[<br> "m5.large",<br> "c5.large"<br>]</pre> | no |
403403
| <a name="input_job_queue_retention_in_seconds"></a> [job\_queue\_retention\_in\_seconds](#input\_job\_queue\_retention\_in\_seconds) | The number of seconds the job is held in the queue before it is purged | `number` | `86400` | no |

modules/runners/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ No modules.
131131
| <a name="input_instance_allocation_strategy"></a> [instance\_allocation\_strategy](#input\_instance\_allocation\_strategy) | The allocation strategy for spot instances. AWS recommends to use `capacity-optimized` however the AWS default is `lowest-price`. | `string` | `"lowest-price"` | no |
132132
| <a name="input_instance_max_spot_price"></a> [instance\_max\_spot\_price](#input\_instance\_max\_spot\_price) | Max price price for spot intances per hour. This variable will be passed to the create fleet as max spot price for the fleet. | `string` | `null` | no |
133133
| <a name="input_instance_profile_path"></a> [instance\_profile\_path](#input\_instance\_profile\_path) | The path that will be added to the instance\_profile, if not set the environment name will be used. | `string` | `null` | no |
134-
| <a name="input_instance_targeet_capacity_type"></a> [instance\_targeet\_capacity\_type](#input\_instance\_targeet\_capacity\_type) | Default lifecyle used runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
134+
| <a name="input_instance_target_capacity_type"></a> [instance\_target\_capacity\_type](#input\_instance\_target\_capacity\_type) | Default lifecyle used runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
135135
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | [DEPRECATED] See instance\_types. | `string` | `"m5.large"` | no |
136136
| <a name="input_instance_types"></a> [instance\_types](#input\_instance\_types) | List of instance types for the action runner. Defaults are based on runner\_os (amzn2 for linux and Windows Server Core for win). | `list(string)` | `null` | no |
137137
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | Key pair name | `string` | `null` | no |

modules/runners/variables.tf

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ variable "instance_target_capacity_type" {
6666
description = "Default lifecyle used runner instances, can be either `spot` or `on-demand`."
6767
type = string
6868
default = "spot"
69+
6970
validation {
70-
condition = anytrue([
71-
var.instance_targeet_capacity_type == "spot",
72-
var.instance_targeet_capacity_type == "on-demand",
73-
])
71+
condition = contains(["spot", "on-demand"], var.instance_target_capacity_type)
7472
error_message = "The instance target capacity should be either spot or on-demand."
7573
}
7674
}
@@ -79,13 +77,9 @@ variable "instance_allocation_strategy" {
7977
description = "The allocation strategy for spot instances. AWS recommends to use `capacity-optimized` however the AWS default is `lowest-price`."
8078
type = string
8179
default = "lowest-price"
80+
8281
validation {
83-
condition = anytrue([
84-
var.instance_allocation_strategy == "lowest-price",
85-
var.instance_allocation_strategy == "diversified",
86-
var.instance_allocation_strategy == "capacity-optimized",
87-
var.instance_allocation_strategy == "capacity-optimized-prioritized",
88-
])
82+
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized"], var.instance_allocation_strategy)
8983
error_message = "The instance allocation strategy does not match the allowed values."
9084
}
9185
}

variables.tf

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,7 @@ variable "instance_targeet_capacity_type" {
355355
type = string
356356
default = "spot"
357357
validation {
358-
condition = anytrue([
359-
var.instance_targeet_capacity_type == "spot",
360-
var.instance_targeet_capacity_type == "on-demand",
361-
])
358+
condition = contains(["spot", "on-demand"], var.instance_targeet_capacity_type)
362359
error_message = "The instance target capacity should be either spot or on-demand."
363360
}
364361
}
@@ -368,13 +365,8 @@ variable "instance_allocation_strategy" {
368365
type = string
369366
default = "lowest-price"
370367
validation {
371-
condition = anytrue([
372-
var.instance_allocation_strategy == "lowest-price",
373-
var.instance_allocation_strategy == "diversified",
374-
var.instance_allocation_strategy == "capacity-optimized",
375-
var.instance_allocation_strategy == "capacity-optimized-prioritized",
376-
])
377-
error_message = "The instance allocation strategy does not matched the allowed values."
368+
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized"], var.instance_allocation_strategy)
369+
error_message = "The instance allocation strategy does not match the allowed values."
378370
}
379371
}
380372

@@ -557,11 +549,7 @@ variable "runner_architecture" {
557549
type = string
558550
default = "x64"
559551
validation {
560-
condition = anytrue([
561-
var.runner_architecture == "x64",
562-
var.runner_architecture == "arm64",
563-
])
552+
condition = contains(["x64", "arm64"], var.runner_architecture)
564553
error_message = "`runner_architecture` value not valid, valid values are: `x64` and `arm64`."
565554
}
566-
567555
}

0 commit comments

Comments
 (0)