Skip to content

Commit

Permalink
feat: Support multi-region deployments (#437)
Browse files Browse the repository at this point in the history
* fix: add override for IAM objects name to all IAM resources

* fix: input variable for IAM object name override in cache module

* chore: update comment

* chore: revert unnecessary name changes

* chore: fix typo in description of overrides variable

* feat: add example for multi-region deployment

* docs: update readme

* docs: fix typo

* chore: apply review changes

* feat: remove protected runner setting from configuration
  • Loading branch information
npalm committed May 19, 2022
1 parent 9454f6e commit adbae28
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/runner-multi-region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ No output.
## Outputs

No outputs.
<!-- END_TF_DOCS -->
<!-- END_TF_DOCS -->
18 changes: 18 additions & 0 deletions examples/runner-multi-region/_docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Example - Spot Runner - Public subnets

In this scenario the multiple runner agents can be created with different configuration by instantiating the module multiple times. Runners will scale automatically based on configuration. The S3 cache can be shared cross runners by managing the cache outside the module.

![runners-cache](https://github.com/npalm/assets/raw/master/images/terraform-aws-gitlab-runner/runner-cache.png)

This examples shows:
- Usages of public subnets.
- Usages of multiple runner instances sharing a common cache.
- Overrides for tag naming.
- Registration via GitLab token.
- Auto scaling using `docker+machine` executor.
- Register runner as [protected](https://docs.gitlab.com/ee/ci/runners/configure_runners.html#prevent-runners-from-revealing-sensitive-information).


## Prerequisite

The Terraform version is managed using [tfenv](https://github.com/Zordrak/tfenv). If you are not using `tfenv` please check `.terraform-version` for the tested version.
25 changes: 25 additions & 0 deletions examples/runner-multi-region/_docs/TF_MODULE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Providers

| Name | Version |
|------|---------|
| aws | 2.56 |
| local | 1.4 |
| null | 2.1.2 |
| tls | 2.1.1 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
| aws\_region | AWS region. | `string` | `"eu-west-1"` | no |
| environment | A name that identifies the environment, will used as prefix and for tagging. | `string` | `"runner-public"` | no |
| gitlab\_url | URL of the gitlab instance to connect to. | `string` | `"https://gitlab.com"` | no |
| private\_ssh\_key\_filename | n/a | `string` | `"generated/id_rsa"` | no |
| public\_ssh\_key\_filename | n/a | `string` | `"generated/id_rsa.pub"` | no |
| registration\_token | n/a | `any` | n/a | yes |
| runner\_name | Name of the runner, will be used in the runner config.toml | `string` | `"public-auto"` | no |

## Outputs

No output.

0 comments on commit adbae28

Please sign in to comment.