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
Copy file name to clipboardExpand all lines: README.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,12 @@
7
7
-[Usage](#usage)
8
8
-[Examples](#examples)
9
9
-[Contributors ✨](#contributors-)
10
+
-[Requirements](#requirements)
11
+
-[Providers](#providers)
12
+
-[Modules](#modules)
13
+
-[Resources](#resources)
14
+
-[Inputs](#inputs)
15
+
-[Outputs](#outputs)
10
16
11
17
## The module
12
18
@@ -159,10 +165,8 @@ persist that contains the packaged Lambda function.
159
165
160
166
A few option are provided to access the runner instance:
161
167
162
-
1. Provide a public ssh key to access the runner by setting \`\`.
163
-
2. Provide a EC2 key pair to access the runner by setting \`\`.
164
-
3. Access via the Session Manager (SSM) by setting `enable_runner_ssm_access` to `true`. The policy to allow access via SSM is not very restrictive.
165
-
4. By setting none of the above, no keys or extra policies will be attached to the instance. You can still configure you own policies by attaching them to `runner_agent_role_arn`.
168
+
1. Access via the Session Manager (SSM) by setting `enable_runner_ssm_access` to `true`. The policy to allow access via SSM is not very restrictive.
169
+
2. By setting none of the above, no keys or extra policies will be attached to the instance. You can still configure you own policies by attaching them to `runner_agent_role_arn`.
166
170
167
171
### GitLab runner cache
168
172
@@ -188,7 +192,7 @@ The base image used to host the GitLab Runner agent is the latest available Amaz
188
192
189
193
### Scenario: Basic usage
190
194
191
-
Below is a basic examples of usages of the module. Regarding the dependencies such as a VPC and SSH keys, have a look at the [default example](https://github.com/npalm/terraform-aws-gitlab-runner/tree/develop/examples/runner-default).
195
+
Below is a basic examples of usages of the module. Regarding the dependencies such as a VPC, have a look at the [default example](https://github.com/npalm/terraform-aws-gitlab-runner/tree/develop/examples/runner-default).
A few [examples](https://github.com/npalm/terraform-aws-gitlab-runner/tree/develop/examples/) are provided. Use the following steps to deploy. Ensure your AWS and Terraform environment is set up correctly. All commands below should be run from the `terraform-aws-gitlab-runner/examples/<example-dir>` directory. Don't forget to remove the runners manually from your Gitlab instance as soon as your are done.
268
268
269
-
### SSH keys
270
-
271
-
SSH keys are generated by Terraform and stored in the `generated` directory of each example directory.
272
-
273
269
### Versions
274
270
275
271
The version of Terraform is locked down via tfenv, see the `.terraform-version` file for the expected versions. Providers are locked down as well in the `providers.tf` file.
276
272
277
273
### Configure
278
274
279
-
The examples are configured with defaults that should work in general. The examples are in general configured for the region Ireland `eu-west-1`. The only parameter that needs to be provided is the GitLab registration token. The token can be found in GitLab in the runner section (global, group or repo scope). Create a file `terrafrom.tfvars` and the registration token.
275
+
The examples are configured with defaults that should work in general. The examples are in general configured for the region Ireland `eu-west-1`. The only parameter that needs to be provided is the GitLab registration token. The token can be found in GitLab in the runner section (global, group or repo scope). Create a file `terraform.tfvars` and the registration token.
280
276
281
277
registration_token = "MY_TOKEN"
282
278
@@ -376,6 +372,7 @@ Made with [contributors-img](https://contrib.rocks).
376
372
|[aws_ami.runner](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami)| data source |
377
373
|[aws_availability_zone.runners](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zone)| data source |
378
374
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
375
+
|[aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition)| data source |
379
376
|[aws_subnet.runners](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnet)| data source |
380
377
381
378
## Inputs
@@ -386,7 +383,7 @@ Made with [contributors-img](https://contrib.rocks).
386
383
| <aname="input_allow_iam_service_linked_role_creation"></a> [allow\_iam\_service\_linked\_role\_creation](#input\_allow\_iam\_service\_linked\_role\_creation)| Boolean used to control attaching the policy to a runner instance to create service linked roles. |`bool`|`true`| no |
387
384
| <aname="input_ami_filter"></a> [ami\_filter](#input\_ami\_filter)| List of maps used to create the AMI filter for the Gitlab runner agent AMI. Must resolve to an Amazon Linux 1 or 2 image. |`map(list(string))`| <pre>{<br> "name": [<br> "amzn2-ami-hvm-2.*-x86_64-ebs"<br> ]<br>}</pre> | no |
388
385
| <aname="input_ami_owners"></a> [ami\_owners](#input\_ami\_owners)| The list of owners used to select the AMI of Gitlab runner agent instances. |`list(string)`| <pre>[<br> "amazon"<br>]</pre> | no |
389
-
| <aname="input_arn_format"></a> [arn\_format](#input\_arn\_format)| ARN format to be used. May be changed to support deployment in GovCloud/China regions. |`string`|`"arn:aws"`| no |
386
+
| <aname="input_arn_format"></a> [arn\_format](#input\_arn\_format)|Deprecated! Calculated automatically by the module. ARN format to be used. May be changed to support deployment in GovCloud/China regions. |`string`|`null`| no |
390
387
| <aname="input_asg_delete_timeout"></a> [asg\_delete\_timeout](#input\_asg\_delete\_timeout)| Timeout when trying to delete the Runner ASG. |`string`|`"10m"`| no |
391
388
| <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 |
392
389
| <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`|`true`| no |
@@ -405,6 +402,7 @@ Made with [contributors-img](https://contrib.rocks).
405
402
| <aname="input_cache_expiration_days"></a> [cache\_expiration\_days](#input\_cache\_expiration\_days)| Number of days before cache objects expires. |`number`|`1`| no |
406
403
| <aname="input_cache_shared"></a> [cache\_shared](#input\_cache\_shared)| Enables cache sharing between runners, false by default. |`bool`|`false`| no |
407
404
| <aname="input_cloudwatch_logging_retention_in_days"></a> [cloudwatch\_logging\_retention\_in\_days](#input\_cloudwatch\_logging\_retention\_in\_days)| Retention for cloudwatch logs. Defaults to unlimited |`number`|`0`| no |
405
+
| <aname="input_create_runner_iam_role"></a> [create\_runner\_iam\_role](#input\_create\_runner\_iam\_role)| Whether to create the runner IAM role of the gitlab runner agent EC2 instance. |`bool`|`true`| no |
408
406
| <aname="input_docker_machine_download_url"></a> [docker\_machine\_download\_url](#input\_docker\_machine\_download\_url)| (Optional) By default the module will use `docker_machine_version` to download the GitLab mantained version of Docker Machine. Alternative you can set this property to download location of the distribution of for the OS. See also https://docs.gitlab.com/runner/executors/docker_machine.html#install|`string`|`""`| no |
| <aname="input_docker_machine_iam_policy_arns"></a> [docker\_machine\_iam\_policy\_arns](#input\_docker\_machine\_iam\_policy\_arns)| List of policy ARNs to be added to the instance profile of the docker machine runners. |`list(string)`|`[]`| no |
@@ -447,6 +445,7 @@ Made with [contributors-img](https://contrib.rocks).
447
445
| <aname="input_runner_ami_filter"></a> [runner\_ami\_filter](#input\_runner\_ami\_filter)| List of maps used to create the AMI filter for the Gitlab runner docker-machine AMI. |`map(list(string))`| <pre>{<br> "name": [<br> "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"<br> ]<br>}</pre> | no |
448
446
| <aname="input_runner_ami_owners"></a> [runner\_ami\_owners](#input\_runner\_ami\_owners)| The list of owners used to select the AMI of Gitlab runner docker-machine instances. |`list(string)`| <pre>[<br> "099720109477"<br>]</pre> | no |
449
447
| <aname="input_runner_iam_policy_arns"></a> [runner\_iam\_policy\_arns](#input\_runner\_iam\_policy\_arns)| List of policy ARNs to be added to the instance profile of the gitlab runner agent ec2 instance. |`list(string)`|`[]`| no |
448
+
| <aname="input_runner_iam_role_name"></a> [runner\_iam\_role\_name](#input\_runner\_iam\_role\_name)| IAM role name of the gitlab runner agent EC2 instance. If unspecified then `{name_iam_objects}-instance` is used |`string`|`""`| no |
450
449
| <aname="input_runner_instance_ebs_optimized"></a> [runner\_instance\_ebs\_optimized](#input\_runner\_instance\_ebs\_optimized)| Enable the GitLab runner instance to be EBS-optimized. |`bool`|`true`| no |
451
450
| <aname="input_runner_instance_enable_monitoring"></a> [runner\_instance\_enable\_monitoring](#input\_runner\_instance\_enable\_monitoring)| Enable the GitLab runner instance to have detailed monitoring. |`bool`|`true`| no |
@@ -492,6 +491,7 @@ Made with [contributors-img](https://contrib.rocks).
492
491
| <aname="input_runners_shm_size"></a> [runners\_shm\_size](#input\_runners\_shm\_size)| shm\_size for the runners, will be used in the runner config.toml |`number`|`0`| no |
493
492
| <aname="input_runners_token"></a> [runners\_token](#input\_runners\_token)| Token for the runner, will be used in the runner config.toml. |`string`|`"__REPLACED_BY_USER_DATA__"`| no |
494
493
| <aname="input_runners_use_private_address"></a> [runners\_use\_private\_address](#input\_runners\_use\_private\_address)| Restrict runners to the use of a private IP address. If `runner_agent_uses_private_address` is set to `true`(default), `runners_use_private_address` will also apply for the agent. |`bool`|`true`| no |
494
+
| <aname="input_runners_volume_type"></a> [runners\_volume\_type](#input\_runners\_volume\_type)| Runner instance volume type |`string`|`"gp2"`| no |
495
495
| <aname="input_runners_volumes_tmpfs"></a> [runners\_volumes\_tmpfs](#input\_runners\_volumes\_tmpfs)| Mount a tmpfs in runner container. https://docs.gitlab.com/runner/executors/docker.html#mounting-a-directory-in-ram| <pre>list(object({<br> volume = string<br> options = string<br> }))</pre> |`[]`| no |
496
496
| <aname="input_schedule_config"></a> [schedule\_config](#input\_schedule\_config)| Map containing the configuration of the ASG scale-in and scale-up for the runner instance. Will only be used if enable\_schedule is set to true. |`map(any)`| <pre>{<br> "scale_in_count": 0,<br> "scale_in_recurrence": "0 18 * * 1-5",<br> "scale_out_count": 1,<br> "scale_out_recurrence": "0 8 * * 1-5"<br>}</pre> | no |
497
497
| <aname="input_secure_parameter_store_runner_sentry_dsn"></a> [secure\_parameter\_store\_runner\_sentry\_dsn](#input\_secure\_parameter\_store\_runner\_sentry\_dsn)| The Sentry DSN name used to store the Sentry DSN in Secure Parameter Store |`string`|`"sentry-dsn"`| no |
0 commit comments