Skip to content

Commit

Permalink
feat: Allow setting the market_options runners module to disable spot…
Browse files Browse the repository at this point in the history
… instances (#657)

* Allow setting the market_options runners module value

* Update README.md

* fix readme

* pass variable through module instantiation

* Update variables.tf

Co-authored-by: Niek Palm <[email protected]>

Co-authored-by: Niek Palm <[email protected]>
  • Loading branch information
dimisjim and npalm authored Mar 11, 2021
1 parent fc618ad commit 7a68734
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ No requirements.
| lambda\_subnet\_ids | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |
| 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 |
| manage\_kms\_key | Let the module manage the KMS key. | `bool` | `true` | no |
| market\_options | Set it to null to use on demand runners. | `string` | `"spot"` | no |
| minimum\_running\_time\_in\_minutes | The time an ec2 action runner should be running at minimum before terminated if non busy. | `number` | `5` | no |
| role\_path | The path that will be added to role path for created roles, if not set the environment name will be used. | `string` | `null` | no |
| role\_permissions\_boundary | Permissions boundary that will be added to the created roles. | `string` | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module "runners" {
s3_location_runner_binaries = local.s3_action_runner_url

instance_type = var.instance_type
market_options = var.market_options
block_device_mappings = var.block_device_mappings

runner_architecture = local.runner_architecture
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,9 @@ variable "runner_additional_security_group_ids" {
type = list(string)
default = []
}

variable "market_options" {
description = "Market options for the action runner instances. Setting the value to `null` let the scaler create on-demand instances instead of spot instanes."
type = string
default = "spot"
}

0 comments on commit 7a68734

Please sign in to comment.