Skip to content

Commit ea998c0

Browse files
authored
feature: Add ability to override instance_type (#42)
1 parent 6e4df0c commit ea998c0

File tree

3 files changed

+45
-37
lines changed

3 files changed

+45
-37
lines changed

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -224,55 +224,55 @@ The following sub modules are optional and are provided as example or utility:
224224
- _[setup-iam-permissions](./modules/setup-iam-permissions/README.md)_ - Example module to setup permission boundaries
225225

226226
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
227-
228227
## Requirements
229228

230229
No requirements.
231230

232231
## Providers
233232

234-
| Name | Version |
235-
| ------ | ------- |
236-
| aws | n/a |
237-
| random | n/a |
233+
| Name | Version |
234+
|------|---------|
235+
| aws | n/a |
236+
| random | n/a |
238237

239238
## Inputs
240239

241-
| Name | Description | Type | Default | Required |
242-
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- | :------: |
243-
| aws_region | AWS region. | `string` | n/a | yes |
244-
| enable_organization_runners | n/a | `bool` | n/a | yes |
245-
| encrypt_secrets | Encrypt secret variables for lambda's such as secrets and private keys. | `bool` | `true` | no |
246-
| environment | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
247-
| github_app | GitHub app parameters, see your github aapp. Ensure the key is base64 encoded. | <pre>object({<br> key_base64 = string<br> id = string<br> client_id = string<br> client_secret = string<br> webhook_secret = string<br> })</pre> | n/a | yes |
248-
| 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 |
249-
| kms_key_id | Custom KMS key to encrypted lambda secrets, if not provided and `encrypt_secrets` = `true` a KMS key will be created by the module. Secrets will be encrypted with a context `Environment = var.environment`. | `string` | `null` | no |
250-
| manage_kms_key | Let the module manage the KMS key. | `bool` | `true` | no |
251-
| minimum_running_time_in_minutes | The time an ec2 action runner should be running at minium before terminated if non busy. | `number` | `5` | no |
252-
| 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 |
253-
| role_permissions_boundary | Permissions boundary that will be added to the created roles. | `string` | `null` | no |
254-
| runner_as_root | Run the action runner under the root user. | `bool` | `false` | no |
255-
| runner_binaries_syncer_lambda_timeout | Time out of the binaries sync lambda in seconds. | `number` | `300` | no |
256-
| runner_binaries_syncer_lambda_zip | File location of the binaries sync lambda zip file. | `string` | `null` | no |
257-
| runner_extra_labels | Extra labels for the runners (GitHub). Separate each label by a comma | `string` | `""` | no |
258-
| runners_lambda_zip | File location of the lambda zip file for scaling runners. | `string` | `null` | no |
259-
| runners_maxiumum_count | The maxiumum number of runners tha will be created. | `number` | `3` | no |
260-
| runners_scale_down_lambda_timeout | Time out for the scale up lambda in seconds. | `number` | `60` | no |
261-
| runners_scale_up_lambda_timeout | Time out for the scale down lambda in seconds. | `number` | `60` | no |
262-
| scale_down_schedule_expression | Scheduler expression to check every x for scale down. | `string` | `"cron(*/5 * * * ? *)"` | no |
263-
| 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)` | n/a | yes |
264-
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no |
265-
| vpc_id | The VPC for security groups of the action runners. | `string` | n/a | yes |
266-
| webhook_lambda_timeout | Time out of the webhook lambda in seconds. | `number` | `10` | no |
267-
| webhook_lambda_zip | File location of the wehbook lambda zip file. | `string` | `null` | no |
240+
| Name | Description | Type | Default | Required |
241+
|------|-------------|------|---------|:--------:|
242+
| aws\_region | AWS region. | `string` | n/a | yes |
243+
| enable\_organization\_runners | n/a | `bool` | n/a | yes |
244+
| encrypt\_secrets | Encrypt secret variables for lambda's such as secrets and private keys. | `bool` | `true` | no |
245+
| environment | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
246+
| github\_app | GitHub app parameters, see your github aapp. Ensure the key is base64 encoded. | <pre>object({<br> key_base64 = string<br> id = string<br> client_id = string<br> client_secret = string<br> webhook_secret = string<br> })</pre> | n/a | yes |
247+
| 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 |
248+
| instance\_type | Instance type for the action runner. | `string` | `"m5.large"` | no |
249+
| kms\_key\_id | Custom KMS key to encrypted lambda secrets, if not provided and `encrypt_secrets` = `true` a KMS key will be created by the module. Secrets will be encrypted with a context `Environment = var.environment`. | `string` | `null` | no |
250+
| manage\_kms\_key | Let the module manage the KMS key. | `bool` | `true` | no |
251+
| minimum\_running\_time\_in\_minutes | The time an ec2 action runner should be running at minium before terminated if non busy. | `number` | `5` | no |
252+
| 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 |
253+
| role\_permissions\_boundary | Permissions boundary that will be added to the created roles. | `string` | `null` | no |
254+
| runner\_as\_root | Run the action runner under the root user. | `bool` | `false` | no |
255+
| runner\_binaries\_syncer\_lambda\_timeout | Time out of the binaries sync lambda in seconds. | `number` | `300` | no |
256+
| runner\_binaries\_syncer\_lambda\_zip | File location of the binaries sync lambda zip file. | `string` | `null` | no |
257+
| runner\_extra\_labels | Extra labels for the runners (GitHub). Separate each label by a comma | `string` | `""` | no |
258+
| runners\_lambda\_zip | File location of the lambda zip file for scaling runners. | `string` | `null` | no |
259+
| runners\_maxiumum\_count | The maxiumum number of runners tha will be created. | `number` | `3` | no |
260+
| runners\_scale\_down\_lambda\_timeout | Time out for the scale up lambda in seconds. | `number` | `60` | no |
261+
| runners\_scale\_up\_lambda\_timeout | Time out for the scale down lambda in seconds. | `number` | `60` | no |
262+
| scale\_down\_schedule\_expression | Scheduler expression to check every x for scale down. | `string` | `"cron(*/5 * * * ? *)"` | no |
263+
| 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)` | n/a | yes |
264+
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no |
265+
| vpc\_id | The VPC for security groups of the action runners. | `string` | n/a | yes |
266+
| webhook\_lambda\_timeout | Time out of the webhook lambda in seconds. | `number` | `10` | no |
267+
| webhook\_lambda\_zip | File location of the wehbook lambda zip file. | `string` | `null` | no |
268268

269269
## Outputs
270270

271-
| Name | Description |
272-
| --------------- | ----------- |
273-
| binaries_syncer | n/a |
274-
| runners | n/a |
275-
| webhook | n/a |
271+
| Name | Description |
272+
|------|-------------|
273+
| binaries\_syncer | n/a |
274+
| runners | n/a |
275+
| webhook | n/a |
276276

277277
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
278278

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ module "runners" {
6060
s3_bucket_runner_binaries = module.runner_binaries.bucket
6161
s3_location_runner_binaries = local.s3_action_runner_url
6262

63+
instance_type = var.instance_type
64+
6365
sqs_build_queue = aws_sqs_queue.queued_builds
6466
github_app = var.github_app
6567
enable_organization_runners = var.enable_organization_runners

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ variable "instance_profile_path" {
120120
default = null
121121
}
122122

123+
variable "instance_type" {
124+
description = "Instance type for the action runner."
125+
type = string
126+
default = "m5.large"
127+
}
128+
123129
variable "runner_as_root" {
124130
description = "Run the action runner under the root user."
125131
type = bool

0 commit comments

Comments
 (0)