You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration is only required when using pre-build AMI with your tailored start-runner script. Before all parameters were based on convetion. We have update them to be predictable with still similar conventions as default.
We set the tag ghr:ssm_config_path as EC2 instance tag to the path used for the configuration. In the config path we store the same values as before (run_as, enable_cloudwatch, agent_mode). The tokens are stored in a separate location which can be retrieved by looking up the value token_path in the config.
For a more details example check-out the following diffs:
Linux start script // TODO UPDATE AFTER MERGE
Windows start script // TODO UPDATE AFTER MERGE
@@ -87,6 +88,26 @@ To be able to support a number of use-cases the module has quite a lot of config
87
88
- Spot vs on-demand. The runners use either the EC2 spot or on-demand life cycle. Runners will be created via the AWS [CreateFleet API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet.html). The module (scale up lambda) will request via the CreateFleet API to create instances in one of the subnets and of the specified instance types.
88
89
- ARM64 support via Graviton/Graviton2 instance-types. When using the default example or top-level module, specifying `instance_types` that match a Graviton/Graviton 2 (ARM64) architecture (e.g. a1, t4g or any 6th-gen `g` or `gd` type), you must also specify `runner_architecture = "arm64"` and the sub-modules will be automatically configured to provision with ARM64 AMIs and leverage GitHub's ARM64 action runner. See below for more details.
89
90
91
+
### AWS SSM Parameters
92
+
93
+
The module uses the AWS System Manager Parameter store to store configuration for the runners, registration tokens and secrets for the Lambda's. Via the variable `ssm_paths` paths for the parameters can be configured. The location of the configuration parameters is retrieved buy the runners via the instance tag `ghr:ssm_config_path`. The following default paths will be used.
94
+
95
+
| Path | Description |
96
+
| ----------- | ----------- |
97
+
|`ssm_paths.root`/`var.prefix`?/app/ | App secrets used by Lambda's |
98
+
|`ssm_paths.root`/`var.prefix`?/runners/config/`<name>`| Configuration parameters used by runner start script |
99
+
|`ssm_paths.root`/`var.prefix`?/runners/tokens/`<ec2-instance-id>`| Registration tokens for the runners generate by the scale-up lambda, consumed by the start script on the runner. |
100
+
101
+
Available configuration parameters:
102
+
103
+
| Parameter name | Description |
104
+
| ----------- | ----------- |
105
+
|`agent_mode`| Indicates if the agent is running in ephemeral mode or not. |
106
+
|`enable_cloudwatch`| Configuration for the cloudwatch agent to stream logging. |
107
+
|`run_as`| The user used for running the GitHub action runner agent. |
108
+
|`token_path`| The path where tokens are stored. |
109
+
110
+
90
111
## Usages
91
112
92
113
Examples are provided in [the example directory](examples/). Please ensure you have installed the following tools.
@@ -380,15 +401,16 @@ We welcome any improvement to the standard module to make the default as secure
@@ -455,7 +477,7 @@ We welcome any improvement to the standard module to make the default as secure
455
477
| <aname="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture)| AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. |`string`|`"x86_64"`| no |
456
478
| <aname="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals)| (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> |`[]`| no |
457
479
| <aname="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime)| AWS Lambda runtime. |`string`|`"nodejs16.x"`| no |
458
-
| <aname="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket)| S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. |`any`|`null`| no |
480
+
| <aname="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket)| S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. |`string`|`null`| no |
459
481
| <aname="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids)| List of security group IDs associated with the Lambda function. |`list(string)`|`[]`| no |
460
482
| <aname="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_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 |
461
483
| <aname="input_log_level"></a> [log\_level](#input\_log\_level)| Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. |`string`|`"info"`| no |
@@ -494,25 +516,26 @@ We welcome any improvement to the standard module to make the default as secure
494
516
| <aname="input_runner_metadata_options"></a> [runner\_metadata\_options](#input\_runner\_metadata\_options)| Metadata options for the ec2 runner instances. By default, the module uses metadata tags for bootstrapping the runner, only disable `instance_metadata_tags` when using custom scripts for starting the runner. |`map(any)`| <pre>{<br> "http_endpoint": "enabled",<br> "http_put_response_hop_limit": 1,<br> "http_tokens": "optional",<br> "instance_metadata_tags": "enabled"<br>}</pre> | no |
495
517
| <aname="input_runner_os"></a> [runner\_os](#input\_runner\_os)| The EC2 Operating System type to use for action runner instances (linux,windows). |`string`|`"linux"`| no |
496
518
| <aname="input_runner_run_as"></a> [runner\_run\_as](#input\_runner\_run\_as)| Run the GitHub actions agent as user. |`string`|`"ec2-user"`| no |
497
-
| <aname="input_runners_lambda_s3_key"></a> [runners\_lambda\_s3\_key](#input\_runners\_lambda\_s3\_key)| S3 key for runners lambda function. Required if using S3 bucket to specify lambdas. |`any`|`null`| no |
498
-
| <aname="input_runners_lambda_s3_object_version"></a> [runners\_lambda\_s3\_object\_version](#input\_runners\_lambda\_s3\_object\_version)| S3 object version for runners lambda function. Useful if S3 versioning is enabled on source bucket. |`any`|`null`| no |
519
+
| <aname="input_runners_lambda_s3_key"></a> [runners\_lambda\_s3\_key](#input\_runners\_lambda\_s3\_key)| S3 key for runners lambda function. Required if using S3 bucket to specify lambdas. |`string`|`null`| no |
520
+
| <aname="input_runners_lambda_s3_object_version"></a> [runners\_lambda\_s3\_object\_version](#input\_runners\_lambda\_s3\_object\_version)| S3 object version for runners lambda function. Useful if S3 versioning is enabled on source bucket. |`string`|`null`| no |
499
521
| <aname="input_runners_lambda_zip"></a> [runners\_lambda\_zip](#input\_runners\_lambda\_zip)| File location of the lambda zip file for scaling runners. |`string`|`null`| no |
500
522
| <aname="input_runners_maximum_count"></a> [runners\_maximum\_count](#input\_runners\_maximum\_count)| The maximum number of runners that will be created. |`number`|`3`| no |
501
523
| <aname="input_runners_scale_down_lambda_timeout"></a> [runners\_scale\_down\_lambda\_timeout](#input\_runners\_scale\_down\_lambda\_timeout)| Time out for the scale down lambda in seconds. |`number`|`60`| no |
502
524
| <aname="input_runners_scale_up_lambda_timeout"></a> [runners\_scale\_up\_lambda\_timeout](#input\_runners\_scale\_up\_lambda\_timeout)| Time out for the scale up lambda in seconds. |`number`|`30`| no |
503
525
| <aname="input_scale_down_schedule_expression"></a> [scale\_down\_schedule\_expression](#input\_scale\_down\_schedule\_expression)| Scheduler expression to check every x for scale down. |`string`|`"cron(*/5 * * * ? *)"`| no |
504
526
| <aname="input_scale_up_reserved_concurrent_executions"></a> [scale\_up\_reserved\_concurrent\_executions](#input\_scale\_up\_reserved\_concurrent\_executions)| Amount of reserved concurrent executions for the scale-up lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. |`number`|`1`| no |
527
+
| <aname="input_ssm_paths"></a> [ssm\_paths](#input\_ssm\_paths)| The root path used in SSM to store configuration and secreets. | <pre>object({<br> root = string<br> use_prefix = bool<br> app = string<br> runners = string<br> })</pre> | <pre>{<br> "app": "app",<br> "root": "github-action-runners",<br> "runners": "runners",<br> "use_prefix": true<br>}</pre> | no |
505
528
| <aname="input_subnet_ids"></a> [subnet\_ids](#input\_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 |
506
-
| <aname="input_syncer_lambda_s3_key"></a> [syncer\_lambda\_s3\_key](#input\_syncer\_lambda\_s3\_key)| S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas. |`any`|`null`| no |
507
-
| <aname="input_syncer_lambda_s3_object_version"></a> [syncer\_lambda\_s3\_object\_version](#input\_syncer\_lambda\_s3\_object\_version)| S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. |`any`|`null`| no |
529
+
| <aname="input_syncer_lambda_s3_key"></a> [syncer\_lambda\_s3\_key](#input\_syncer\_lambda\_s3\_key)| S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas. |`string`|`null`| no |
530
+
| <aname="input_syncer_lambda_s3_object_version"></a> [syncer\_lambda\_s3\_object\_version](#input\_syncer\_lambda\_s3\_object\_version)| S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. |`string`|`null`| no |
508
531
| <aname="input_tags"></a> [tags](#input\_tags)| Map of tags that will be added to created resources. By default resources will be tagged with name and environment. |`map(string)`|`{}`| no |
509
532
| <aname="input_userdata_post_install"></a> [userdata\_post\_install](#input\_userdata\_post\_install)| Script to be ran after the GitHub Actions runner is installed on the EC2 instances |`string`|`""`| no |
510
533
| <aname="input_userdata_pre_install"></a> [userdata\_pre\_install](#input\_userdata\_pre\_install)| Script to be ran before the GitHub Actions runner is installed on the EC2 instances |`string`|`""`| no |
511
534
| <aname="input_userdata_template"></a> [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 |
512
535
| <aname="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id)| The VPC for security groups of the action runners. |`string`| n/a | yes |
513
536
| <aname="input_webhook_lambda_apigateway_access_log_settings"></a> [webhook\_lambda\_apigateway\_access\_log\_settings](#input\_webhook\_lambda\_apigateway\_access\_log\_settings)| n/a | <pre>object({<br> destination_arn = string<br> format = string<br> })</pre> |`null`| no |
514
-
| <aname="input_webhook_lambda_s3_key"></a> [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 |
515
-
| <aname="input_webhook_lambda_s3_object_version"></a> [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 |
537
+
| <aname="input_webhook_lambda_s3_key"></a> [webhook\_lambda\_s3\_key](#input\_webhook\_lambda\_s3\_key)| S3 key for webhook lambda function. Required if using S3 bucket to specify lambdas. |`string`|`null`| no |
538
+
| <aname="input_webhook_lambda_s3_object_version"></a> [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. |`string`|`null`| no |
516
539
| <aname="input_webhook_lambda_timeout"></a> [webhook\_lambda\_timeout](#input\_webhook\_lambda\_timeout)| Time out of the webhook lambda in seconds. |`number`|`10`| no |
517
540
| <aname="input_webhook_lambda_zip"></a> [webhook\_lambda\_zip](#input\_webhook\_lambda\_zip)| File location of the webhook lambda zip file. |`string`|`null`| no |
518
541
| <aname="input_workflow_job_queue_configuration"></a> [workflow\_job\_queue\_configuration](#input\_workflow\_job\_queue\_configuration)| Configuration options for workflow job queue which is only applicable if the flag enable\_workflow\_job\_events\_queue is set to true. | <pre>object({<br> delay_seconds = number<br> visibility_timeout_seconds = number<br> message_retention_seconds = number<br> })</pre> | <pre>{<br> "delay_seconds": null,<br> "message_retention_seconds": null,<br> "visibility_timeout_seconds": null<br>}</pre> | no |
0 commit comments