diff --git a/README.md b/README.md index e1b8142d0e..e318676e0d 100644 --- a/README.md +++ b/README.md @@ -364,13 +364,13 @@ In case the setup does not work as intended follow the trace of events: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.14.1 | -| [aws](#requirement\_aws) | ~> 3.38 | +| [aws](#requirement\_aws) | ~> 3.50 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 3.38 | +| [aws](#provider\_aws) | ~> 3.50 | | [random](#provider\_random) | n/a | ## Modules @@ -402,7 +402,7 @@ In case the setup does not work as intended follow the trace of events: | [ami\_owners](#input\_ami\_owners) | The list of owners used to select the AMI of action runner instances. | `list(string)` |
[
"amazon"
]
| no | | [aws\_partition](#input\_aws\_partition) | (optiona) partition in the arn namespace to use if not 'aws' | `string` | `"aws"` | no | | [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes | -| [block\_device\_mappings](#input\_block\_device\_mappings) | The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops` |
list(object({
device_name = string
delete_on_termination = bool
volume_type = string
volume_size = number
encrypted = bool
iops = number
}))
| `[]` | no | +| [block\_device\_mappings](#input\_block\_device\_mappings) | The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops` |
list(object({
device_name = string
delete_on_termination = bool
volume_type = string
volume_size = number
encrypted = bool
iops = number
}))
|
[
{
"delete_on_termination": true,
"device_name": "/dev/xvd",
"encrypted": true,
"iops": null,
"volume_size": 30,
"volume_type": "gp3"
}
]
| no | | [cloudwatch\_config](#input\_cloudwatch\_config) | (optional) Replaces the module default cloudwatch log config. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html for details. | `string` | `null` | no | | [create\_service\_linked\_role\_spot](#input\_create\_service\_linked\_role\_spot) | (optional) create the serviced linked role for spot instances that is required by the scale-up lambda. | `bool` | `false` | no | | [delay\_webhook\_event](#input\_delay\_webhook\_event) | The number of seconds the event accepted by the webhook is invisible on the queue before the scale up lambda will receive the event. | `number` | `30` | no | @@ -480,7 +480,7 @@ In case the setup does not work as intended follow the trace of events: | [userdata\_post\_install](#input\_userdata\_post\_install) | Script to be ran after the GitHub Actions runner is installed on the EC2 instances | `string` | `""` | no | | [userdata\_pre\_install](#input\_userdata\_pre\_install) | Script to be ran before the GitHub Actions runner is installed on the EC2 instances | `string` | `""` | no | | [userdata\_template](#input\_userdata\_template) | Alternative user-data template, replacing the default template. By providing your own user\_data you have to take care of installing all required software, including the action runner. Variables userdata\_pre/post\_install are ignored. | `string` | `null` | no | -| [volume\_size](#input\_volume\_size) | Size of runner volume | `number` | `30` | no | +| [volume\_size](#input\_volume\_size) | (Deprecaated, use block\_device\_mappings. Size of runner volume, if set it overrides the value provide via block\_device\_mappings. | `number` | `null` | no | | [vpc\_id](#input\_vpc\_id) | The VPC for security groups of the action runners. | `string` | n/a | yes | | [webhook\_lambda\_s3\_key](#input\_webhook\_lambda\_s3\_key) | S3 key for webhook lambda function. Required if using S3 bucket to specify lambdas. | `any` | `null` | no | | [webhook\_lambda\_s3\_object\_version](#input\_webhook\_lambda\_s3\_object\_version) | S3 object version for webhook lambda function. Useful if S3 versioning is enabled on source bucket. | `any` | `null` | no | diff --git a/examples/default/main.tf b/examples/default/main.tf index 68d8903049..5dc56b2423 100644 --- a/examples/default/main.tf +++ b/examples/default/main.tf @@ -30,12 +30,14 @@ module "runners" { webhook_secret = random_id.random.hex } + block_device_mappings = [] + # Grab zip files via lambda_download - webhook_lambda_zip = "lambdas-download/webhook.zip" - runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip" - runners_lambda_zip = "lambdas-download/runners.zip" + # webhook_lambda_zip = "lambdas-download/webhook.zip" + # runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip" + # runners_lambda_zip = "lambdas-download/runners.zip" - enable_organization_runners = false + enable_organization_runners = true runner_extra_labels = "default,example" # enable access to the runners via SSM diff --git a/modules/runners/README.md b/modules/runners/README.md index 7c82ce81cd..4b5ea25787 100644 --- a/modules/runners/README.md +++ b/modules/runners/README.md @@ -117,7 +117,7 @@ yarn run dist | [ami\_owners](#input\_ami\_owners) | The list of owners used to select the AMI of action runner instances. | `list(string)` |
[
"amazon"
]
| no | | [aws\_partition](#input\_aws\_partition) | (optional) partition for the base arn if not 'aws' | `string` | `"aws"` | no | | [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes | -| [block\_device\_mappings](#input\_block\_device\_mappings) | The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops` |
list(object({
device_name = string
delete_on_termination = bool
volume_type = string
volume_size = number
encrypted = bool
iops = number
}))
| `[]` | no | +| [block\_device\_mappings](#input\_block\_device\_mappings) | The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops` |
list(object({
device_name = string
delete_on_termination = bool
volume_type = string
volume_size = number
encrypted = bool
iops = number
}))
|
[
{
"delete_on_termination": true,
"device_name": "/dev/xvd",
"encrypted": true,
"iops": null,
"volume_size": 30,
"volume_type": "gp3"
}
]
| no | | [cloudwatch\_config](#input\_cloudwatch\_config) | (optional) Replaces the module default cloudwatch log config. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html for details. | `string` | `null` | no | | [create\_service\_linked\_role\_spot](#input\_create\_service\_linked\_role\_spot) | (optional) create the service linked role for spot instances that is required by the scale-up lambda. | `bool` | `false` | no | | [disable\_runner\_autoupdate](#input\_disable\_runner\_autoupdate) | Disable the auto update of the github runner agent. Be-aware there is a grace period of 30 days, see also the [GitHub article](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/) | `bool` | `false` | no | @@ -186,7 +186,7 @@ yarn run dist | [userdata\_post\_install](#input\_userdata\_post\_install) | User-data script snippet to insert after GitHub action runner install | `string` | `""` | no | | [userdata\_pre\_install](#input\_userdata\_pre\_install) | User-data script snippet to insert before GitHub action runner install | `string` | `""` | no | | [userdata\_template](#input\_userdata\_template) | Alternative user-data template, replacing the default template. By providing your own user\_data you have to take care of installing all required software, including the action runner. Variables userdata\_pre/post\_install are ignored. | `string` | `null` | no | -| [volume\_size](#input\_volume\_size) | Size of runner volume | `number` | `30` | no | +| [volume\_size](#input\_volume\_size) | (Deprecaated, use block\_device\_mappings. Size of runner volume, if set it overrides the value provide via block\_device\_mappings. | `number` | `null` | no | | [vpc\_id](#input\_vpc\_id) | The VPC for the security groups. | `string` | n/a | yes | ## Outputs @@ -196,6 +196,7 @@ yarn run dist | [lambda\_scale\_down](#output\_lambda\_scale\_down) | n/a | | [lambda\_scale\_up](#output\_lambda\_scale\_up) | n/a | | [launch\_template](#output\_launch\_template) | n/a | +| [role\_pool](#output\_role\_pool) | n/a | | [role\_runner](#output\_role\_runner) | n/a | | [role\_scale\_down](#output\_role\_scale\_down) | n/a | | [role\_scale\_up](#output\_role\_scale\_up) | n/a | diff --git a/modules/runners/main.tf b/modules/runners/main.tf index e1352b4175..036b23f91d 100644 --- a/modules/runners/main.tf +++ b/modules/runners/main.tf @@ -64,7 +64,7 @@ resource "aws_launch_template" "runner" { ebs { delete_on_termination = lookup(block_device_mappings.value, "delete_on_termination", true) volume_type = lookup(block_device_mappings.value, "volume_type", "gp3") - volume_size = lookup(block_device_mappings.value, "volume_size", var.volume_size) + volume_size = var.volume_size == null ? lookup(block_device_mappings.value, "volume_size", "30") : var.volume_size encrypted = lookup(block_device_mappings.value, "encrypted", true) iops = lookup(block_device_mappings.value, "iops", null) } diff --git a/modules/runners/variables.tf b/modules/runners/variables.tf index e8a4a164bb..8582136ad3 100644 --- a/modules/runners/variables.tf +++ b/modules/runners/variables.tf @@ -55,7 +55,14 @@ variable "block_device_mappings" { encrypted = bool iops = number })) - default = [] + default = [{ + device_name = "/dev/xvd" + delete_on_termination = true + volume_type = "gp3" + volume_size = 30 + encrypted = true + iops = null + }] } variable "market_options" { @@ -397,9 +404,9 @@ variable "runner_additional_security_group_ids" { } variable "volume_size" { - description = "Size of runner volume" + description = "(Deprecaated, use block_device_mappings. Size of runner volume, if set it overrides the value provide via block_device_mappings." type = number - default = 30 + default = null } variable "kms_key_arn" { diff --git a/variables.tf b/variables.tf index 031d59927d..edbe990f30 100644 --- a/variables.tf +++ b/variables.tf @@ -233,7 +233,14 @@ variable "block_device_mappings" { encrypted = bool iops = number })) - default = [] + default = [{ + device_name = "/dev/xvd" + delete_on_termination = true + volume_type = "gp3" + volume_size = 30 + encrypted = true + iops = null + }] } variable "ami_filter" { @@ -390,9 +397,9 @@ variable "instance_max_spot_price" { } variable "volume_size" { - description = "Size of runner volume" + description = "(Deprecaated, use block_device_mappings. Size of runner volume, if set it overrides the value provide via block_device_mappings." type = number - default = 30 + default = null } variable "instance_type" {