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
feat(runners): Add support for looking up runner AMI ID from an SSM parameter at instance launch time (#2520)
* Add support for looking up a pre-built runner AMI ID from an SSM parameter
* Format terraform code
* Format TS code
* Add tests
* Make error message more helpful
* Fixes per comments
* Re-format terraform code
* Sync var description
* Add scale up test for overridden AMI ID
* Fix iam role policy name
* Add example
This extendible format allows to add more fields to be added if needed.
330
330
You can configure the queue by setting properties to `workflow_job_events_queue_config`
331
331
332
+
NOTE: By default, a runner AMI update requires a re-apply of this terraform config (the runner AMI ID is looked up by a terraform data source). To avoid this, you can use `ami_id_ssm_parameter_name` to have the scale-up lambda dynamically lookup the runner AMI ID from an SSM parameter at instance launch time. Said SSM parameter is managed outside of this module (e.g. by a runner AMI build workflow).
333
+
332
334
## Examples
333
335
334
336
Examples are located in the [examples](./examples) directory. The following examples are provided:
@@ -419,6 +421,7 @@ We welcome any improvement to the standard module to make the default as secure
| <aname="input_ami_filter"></a> [ami\_filter](#input\_ami\_filter)| List of maps used to create the AMI filter for the action runner AMI. By default amazon linux 2 is used. |`map(list(string))`|`null`| no |
421
423
| <aname="input_ami_owners"></a> [ami\_owners](#input\_ami\_owners)| The list of owners used to select the AMI of action runner instances. |`list(string)`| <pre>[<br> "amazon"<br>]</pre> | no |
424
+
| <aname="input_ami_id_ssm_parameter_name"></a> [ami\_id\_ssm\_parameter\_name](#input\_ami\_id\_ssm\_parameter\_name)| Optional SSM parameter that contains the runner AMI ID to launch instances from. Overrides `ami_filter`. The parameter value is managed outside of this module (e.g. in a runner AMI build workflow). This allows for AMI updates without having to re-apply this terraform config. |`string`|`null`| no |
422
425
| <aname="input_aws_partition"></a> [aws\_partition](#input\_aws\_partition)| (optiona) partition in the arn namespace to use if not 'aws' |`string`|`"aws"`| no |
Copy file name to clipboardExpand all lines: modules/runners/variables.tf
+6
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,12 @@ variable "ami_owners" {
155
155
default=["amazon"]
156
156
}
157
157
158
+
variable"ami_id_ssm_parameter_name" {
159
+
description="Externally managed SSM parameter (of data type aws:ec2:image) that contains the AMI ID to launch runner instances from. Overrides ami_filter"
160
+
type=string
161
+
default=null
162
+
}
163
+
158
164
variable"enabled_userdata" {
159
165
description="Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI"
Copy file name to clipboardExpand all lines: variables.tf
+8
Original file line number
Diff line number
Diff line change
@@ -302,11 +302,19 @@ variable "ami_filter" {
302
302
type=map(list(string))
303
303
default=null
304
304
}
305
+
305
306
variable"ami_owners" {
306
307
description="The list of owners used to select the AMI of action runner instances."
307
308
type=list(string)
308
309
default=["amazon"]
309
310
}
311
+
312
+
variable"ami_id_ssm_parameter_name" {
313
+
description="Externally managed SSM parameter (of data type aws:ec2:image) that contains the AMI ID to launch runner instances from. Overrides ami_filter"
314
+
type=string
315
+
default=null
316
+
}
317
+
310
318
variable"lambda_s3_bucket" {
311
319
description="S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly."
0 commit comments