From 185ef20301229ffbdc81874cee2c13f296256036 Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Fri, 6 May 2022 08:26:14 +0200 Subject: [PATCH] fix: Wrong block device mapping (#2019) * fix: block name should default to `dev/xvda` * fix: Wrong default for block device mapping Co-authored-by: Gus Fune --- README.md | 2 +- examples/default/main.tf | 10 +++++++++- modules/runners/README.md | 2 +- modules/runners/variables.tf | 2 +- variables.tf | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d3669ab436..667d6fbcac 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,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
}))
|
[
{
"delete_on_termination": true,
"device_name": "/dev/xvd",
"encrypted": true,
"iops": null,
"volume_size": 30,
"volume_type": "gp3"
}
]
| 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/xvda",
"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 | diff --git a/examples/default/main.tf b/examples/default/main.tf index 98e6e41533..6ee90a15c8 100644 --- a/examples/default/main.tf +++ b/examples/default/main.tf @@ -30,7 +30,15 @@ module "runners" { webhook_secret = random_id.random.hex } - block_device_mappings = [] + # configure the block device mappings, default for Amazon Linux2 + # block_device_mappings = [{ + # device_name = "/dev/xvda" + # delete_on_termination = true + # volume_type = "gp3" + # volume_size = 10 + # encrypted = true + # iops = null + # }] # Grab zip files via lambda_download webhook_lambda_zip = "lambdas-download/webhook.zip" diff --git a/modules/runners/README.md b/modules/runners/README.md index 2d6fc342d7..990746456d 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
}))
|
[
{
"delete_on_termination": true,
"device_name": "/dev/xvd",
"encrypted": true,
"iops": null,
"volume_size": 30,
"volume_type": "gp3"
}
]
| 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/xvda",
"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 | diff --git a/modules/runners/variables.tf b/modules/runners/variables.tf index 2108a53b5e..ca3e4a7255 100644 --- a/modules/runners/variables.tf +++ b/modules/runners/variables.tf @@ -56,7 +56,7 @@ variable "block_device_mappings" { iops = number })) default = [{ - device_name = "/dev/xvd" + device_name = "/dev/xvda" delete_on_termination = true volume_type = "gp3" volume_size = 30 diff --git a/variables.tf b/variables.tf index cf4713dd1d..7617506d09 100644 --- a/variables.tf +++ b/variables.tf @@ -234,7 +234,7 @@ variable "block_device_mappings" { iops = number })) default = [{ - device_name = "/dev/xvd" + device_name = "/dev/xvda" delete_on_termination = true volume_type = "gp3" volume_size = 30