Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jan 3, 2022
1 parent 6b4ebea commit ecfbed5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ In case the setup does not work as intended follow the trace of events:
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | [DEPRECATED] See instance\_types. | `string` | `null` | no |
| <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 |
| <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 |
Expand Down
2 changes: 1 addition & 1 deletion modules/runners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ No modules.
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | [DEPRECATED] See instance\_types. | `string` | `"m5.large"` | no |
| <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 |
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | Key pair name | `string` | `null` | no |
Expand Down
14 changes: 4 additions & 10 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ variable "instance_target_capacity_type" {
description = "Default lifecyle used runner instances, can be either `spot` or `on-demand`."
type = string
default = "spot"

validation {
condition = anytrue([
var.instance_targeet_capacity_type == "spot",
var.instance_targeet_capacity_type == "on-demand",
])
condition = contains(["spot", "on-demand"], var.instance_target_capacity_type)
error_message = "The instance target capacity should be either spot or on-demand."
}
}
Expand All @@ -79,13 +77,9 @@ variable "instance_allocation_strategy" {
description = "The allocation strategy for spot instances. AWS recommends to use `capacity-optimized` however the AWS default is `lowest-price`."
type = string
default = "lowest-price"

validation {
condition = anytrue([
var.instance_allocation_strategy == "lowest-price",
var.instance_allocation_strategy == "diversified",
var.instance_allocation_strategy == "capacity-optimized",
var.instance_allocation_strategy == "capacity-optimized-prioritized",
])
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized"], var.instance_allocation_strategy)
error_message = "The instance allocation strategy does not match the allowed values."
}
}
Expand Down
20 changes: 4 additions & 16 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,7 @@ variable "instance_targeet_capacity_type" {
type = string
default = "spot"
validation {
condition = anytrue([
var.instance_targeet_capacity_type == "spot",
var.instance_targeet_capacity_type == "on-demand",
])
condition = contains(["spot", "on-demand"], var.instance_targeet_capacity_type)
error_message = "The instance target capacity should be either spot or on-demand."
}
}
Expand All @@ -368,13 +365,8 @@ variable "instance_allocation_strategy" {
type = string
default = "lowest-price"
validation {
condition = anytrue([
var.instance_allocation_strategy == "lowest-price",
var.instance_allocation_strategy == "diversified",
var.instance_allocation_strategy == "capacity-optimized",
var.instance_allocation_strategy == "capacity-optimized-prioritized",
])
error_message = "The instance allocation strategy does not matched the allowed values."
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized"], var.instance_allocation_strategy)
error_message = "The instance allocation strategy does not match the allowed values."
}
}

Expand Down Expand Up @@ -557,11 +549,7 @@ variable "runner_architecture" {
type = string
default = "x64"
validation {
condition = anytrue([
var.runner_architecture == "x64",
var.runner_architecture == "arm64",
])
condition = contains(["x64", "arm64"], var.runner_architecture)
error_message = "`runner_architecture` value not valid, valid values are: `x64` and `arm64`."
}

}

0 comments on commit ecfbed5

Please sign in to comment.