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
* Naming consistency and use the module's "environment" variable
* Remove the term "workers" since it's not a documented term and replace
it with "instances". This is still somewhat ambiguous when
distinguishing between the parent runner 'agent' and the instances it
spawns via docker-machine.
* Remove useless 'create' variable on 'terminate-instances' submodule.
The parent module already toggles 'create' for this module.
* Update Lambda function to include 'pending' instances that should be
terminated.
* Housekeeping - remove unused variables, extraneous comments.
Copy file name to clipboardExpand all lines: README.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -216,20 +216,20 @@ module "runner" {
216
216
217
217
### Auto Scaling Group Instance Termination
218
218
219
-
When the instance in the Auto Scaling Group is terminated, worker instances that were spawned may be left behind unattached to an active runner.
219
+
When the runner in the Auto Scaling Group is terminated, runner instances that were spawned may be left behind unattached to an active runner.
220
220
221
221
This module provides an instance termination [lifecycle hook](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html)
222
-
that executes a provided Lambda function to terminate worker instances that were spawned.
222
+
that executes a provided Lambda function to terminate instances that were spawned.
223
223
224
-
There is a caveat to this scenario in that a worker instance can potentially be running a job
224
+
There is a caveat to this scenario in that a instance can potentially be running a job
225
225
while it receives the termination signal.
226
226
227
227
The use of the termination lifecycle can be toggled using the [`asg_termination_lifecycle_hook_create`](#input_asg_terminate_lifecycle_hook_create) variable.
228
228
229
229
When using this feature, a `builds/` directory relative to the root module will
230
230
persist that contains the packaged Lambda function.
231
231
232
-
Refer to the [terminate-workers module](https://github.com/npalm/terraform-aws-gitlab-runner/tree/develop/modules/terminate-workers) for more information.
232
+
Refer to the [terminate-instances module](https://github.com/npalm/terraform-aws-gitlab-runner/tree/develop/modules/terminate-instances) for more information.
| <aname="input_asg_delete_timeout"></a> [asg\_delete\_timeout](#input\_asg\_delete\_timeout)| Timeout when trying to delete the Runner ASG. |`string`|`"10m"`| no |
349
349
| <aname="input_asg_max_instance_lifetime"></a> [asg\_max\_instance\_lifetime](#input\_asg\_max\_instance\_lifetime)| The seconds before an instance is refreshed in the ASG. |`number`|`null`| no |
350
350
| <aname="input_asg_terminate_lifecycle_hook_create"></a> [asg\_terminate\_lifecycle\_hook\_create](#input\_asg\_terminate\_lifecycle\_hook\_create)| Boolean toggling the creation of the ASG instance terminate lifecycle hook. |`bool`|`false`| no |
351
-
| <aname="input_asg_terminate_lifecycle_hook_create_package"></a> [asg\_terminate\_lifecycle\_hook\_create\_package](#input\_asg\_terminate\_lifecycle\_hook\_create\_package)| Boolean toggling the creation of the ASG instance terminate lifecycle hook Lambda package with the module. False implies it's packaged externally. |`bool`|`true`| no |
352
351
| <aname="input_asg_terminate_lifecycle_hook_heartbeat_timeout"></a> [asg\_terminate\_lifecycle\_hook\_heartbeat\_timeout](#input\_asg\_terminate\_lifecycle\_hook\_heartbeat\_timeout)| The amount of time, in seconds, for the instances to remain in wait state. |`number`|`90`| no |
353
-
| <aname="input_asg_terminate_lifecycle_hook_local_existing_package"></a> [asg\_terminate\_lifecycle\_hook\_local\_existing\_package](#input\_asg\_terminate\_lifecycle\_hook\_local\_existing\_package)| The path to the zip file containing the ASG instance terminate lifecycle hook Lambda package. Use this when the package is built external from the module. |`string`|`null`| no |
354
352
| <aname="input_asg_terminate_lifecycle_hook_name"></a> [asg\_terminate\_lifecycle\_hook\_name](#input\_asg\_terminate\_lifecycle\_hook\_name)| Specifies a custom name for the ASG terminate lifecycle hook and related resources. |`string`|`null`| no |
| <aname="input_cache_bucket"></a> [cache\_bucket](#input\_cache\_bucket)| Configuration to control the creation of the cache bucket. By default the bucket will be created and used as shared cache. To use the same cache across multiple runners disable the creation of the cache and provide a policy and bucket name. See the public runner example for more details. |`map(any)`| <pre>{<br> "bucket": "",<br> "create": true,<br> "policy": ""<br>}</pre> | no |
|[archive_file.terminate_runner_workers_lambda](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file)| data source |
129
+
|[archive_file.terminate_runner_instances_lambda](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file)| data source |
155
130
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
156
131
|[aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
157
132
|[aws_iam_policy_document.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
@@ -161,23 +136,21 @@ No modules.
161
136
| Name | Description | Type | Default | Required |
| <aname="input_asg_arn"></a> [asg\_arn](#input\_asg\_arn)| The ARN of the Auto Scaling Group to attach to. |`string`| n/a | yes |
164
-
| <aname="input_asg_name"></a> [asg\_name](#input\_asg\_name)| The name of the Auto Scaling Group to attach to. |`string`| n/a | yes |
139
+
| <aname="input_asg_name"></a> [asg\_name](#input\_asg\_name)| The name of the Auto Scaling Group to attach to. The 'environment' will be prefixed to this. |`string`| n/a | yes |
165
140
| <aname="input_cloudwatch_logging_retention_in_days"></a> [cloudwatch\_logging\_retention\_in\_days](#input\_cloudwatch\_logging\_retention\_in\_days)| The number of days to retain logs in CloudWatch. |`number`|`30`| no |
166
-
| <aname="input_create"></a> [create](#input\_create)|Boolean toggling whether the reources for the lifecycle hook should be created or not. |`bool`|`true`|no|
167
-
| <aname="input_create_package"></a> [create\_package](#input\_create\_package)|Enable packaging the Lambda function by the module. Requires pip and zip. |`bool`|`true`| no |
141
+
| <aname="input_environment"></a> [environment](#input\_environment)|A name that identifies the environment, used as a name prefix and for tagging. |`string`|n/a|yes|
142
+
| <aname="input_lambda_memory_size"></a> [lambda\_memory\_size](#input\_lambda\_memory\_size)|The memory size in MB to allocate to the Lambda function. |`number`|`128`| no |
168
143
| <aname="input_lifecycle_heartbeat_timeout"></a> [lifecycle\_heartbeat\_timeout](#input\_lifecycle\_heartbeat\_timeout)| The amount of time, in seconds, for the instances to remain in wait state. |`number`|`90`| no |
169
-
| <aname="input_local_existing_package"></a> [local\_existing\_package](#input\_local\_existing\_package)| If a path is specified, this will use an existing ZIP file built externally for the Lambda function rather than attempt to build and package it in the module. |`string`|`null`| no |
170
-
| <aname="input_name"></a> [name](#input\_name)| The name of the Lambda function to create. |`string`| n/a | yes |
171
-
| <aname="input_name_iam_objects"></a> [name\_iam\_objects](#input\_name\_iam\_objects)| The name to use for IAM resources - roles and policies |`string`|`""`| no |
144
+
| <aname="input_name"></a> [name](#input\_name)| The name of the Lambda function to create. The 'environment' will be prefixed to this. |`string`| n/a | yes |
145
+
| <aname="input_name_iam_objects"></a> [name\_iam\_objects](#input\_name\_iam\_objects)| The name to use for IAM resources - roles and policies. |`string`|`""`| no |
172
146
| <aname="input_role_permissions_boundary"></a> [role\_permissions\_boundary](#input\_role\_permissions\_boundary)| An optional IAM permissions boundary to use when creating IAM roles. |`string`|`null`| no |
173
-
| <aname="input_source_path"></a> [source\_path](#input\_source\_path)| Used if 'local\_existing\_package' is not. This is the path to the Lambda function source to build and package. |`list(any)`|`null`| no |
174
147
| <aname="input_tags"></a> [tags](#input\_tags)| Map of tags to apply to resources. |`map(any)`|`{}`| no |
0 commit comments