Skip to content

Commit ccc057f

Browse files
authored
Merge pull request #551 from npalm/develop
chore: Release
2 parents 5aabaef + 6bfca6c commit ccc057f

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

Diff for: .github/workflows/ci.yml

+12
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ jobs:
6565
git-commit-message: "docs: auto update terraform docs"
6666
git-push: true
6767

68+
tfsec:
69+
name: tfsec PR commenter
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Clone repo
74+
uses: actions/checkout@master
75+
- name: tfsec
76+
uses: aquasecurity/[email protected]
77+
with:
78+
github_token: ${{ github.token }}
79+
6880
release:
6981
if: github.event_name != 'pull_request' && contains('refs/heads/main', github.ref)
7082
name: Release

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Made with [contributors-img](https://contrib.rocks).
431431
| <a name="input_gitlab_runner_registration_config"></a> [gitlab\_runner\_registration\_config](#input\_gitlab\_runner\_registration\_config) | Configuration used to register the runner. See the README for an example, or reference the examples in the examples directory of this repo. | `map(string)` | <pre>{<br> "access_level": "",<br> "description": "",<br> "locked_to_project": "",<br> "maximum_timeout": "",<br> "registration_token": "",<br> "run_untagged": "",<br> "tag_list": ""<br>}</pre> | no |
432432
| <a name="input_gitlab_runner_security_group_description"></a> [gitlab\_runner\_security\_group\_description](#input\_gitlab\_runner\_security\_group\_description) | A description for the gitlab-runner security group | `string` | `"A security group containing gitlab-runner agent instances"` | no |
433433
| <a name="input_gitlab_runner_security_group_ids"></a> [gitlab\_runner\_security\_group\_ids](#input\_gitlab\_runner\_security\_group\_ids) | A list of security group ids that are allowed to access the gitlab runner agent | `list(string)` | `[]` | no |
434-
| <a name="input_gitlab_runner_version"></a> [gitlab\_runner\_version](#input\_gitlab\_runner\_version) | Version of the [GitLab runner](https://gitlab.com/gitlab-org/gitlab-runner/-/releases). | `string` | `"14.8.3"` | no |
434+
| <a name="input_gitlab_runner_version"></a> [gitlab\_runner\_version](#input\_gitlab\_runner\_version) | Version of the [GitLab runner](https://gitlab.com/gitlab-org/gitlab-runner/-/releases). | `string` | `"15.3.0"` | no |
435435
| <a name="input_instance_role_json"></a> [instance\_role\_json](#input\_instance\_role\_json) | Default runner instance override policy, expected to be in JSON format. | `string` | `""` | no |
436436
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | Instance type used for the GitLab runner. | `string` | `"t3.micro"` | no |
437437
| <a name="input_kms_alias_name"></a> [kms\_alias\_name](#input\_kms\_alias\_name) | Alias added to the kms\_key (if created and not provided by kms\_key\_id) | `string` | `""` | no |
@@ -464,6 +464,7 @@ Made with [contributors-img](https://contrib.rocks).
464464
| <a name="input_runners_ebs_optimized"></a> [runners\_ebs\_optimized](#input\_runners\_ebs\_optimized) | Enable runners to be EBS-optimized. | `bool` | `true` | no |
465465
| <a name="input_runners_environment_vars"></a> [runners\_environment\_vars](#input\_runners\_environment\_vars) | Environment variables during build execution, e.g. KEY=Value, see runner-public example. Will be used in the runner config.toml | `list(string)` | `[]` | no |
466466
| <a name="input_runners_executor"></a> [runners\_executor](#input\_runners\_executor) | The executor to use. Currently supports `docker+machine` or `docker`. | `string` | `"docker+machine"` | no |
467+
| <a name="input_runners_extra_hosts"></a> [runners\_extra\_hosts](#input\_runners\_extra\_hosts) | Extra hosts that will be used in the runner config.toml, e.g other-host:127.0.0.1 | `list(any)` | `[]` | no |
467468
| <a name="input_runners_gitlab_url"></a> [runners\_gitlab\_url](#input\_runners\_gitlab\_url) | URL of the GitLab instance to connect to. | `string` | n/a | yes |
468469
| <a name="input_runners_helper_image"></a> [runners\_helper\_image](#input\_runners\_helper\_image) | Overrides the default helper image used to clone repos and upload artifacts, will be used in the runner config.toml | `string` | `""` | no |
469470
| <a name="input_runners_iam_instance_profile_name"></a> [runners\_iam\_instance\_profile\_name](#input\_runners\_iam\_instance\_profile\_name) | IAM instance profile name of the runners, will be used in the runner config.toml | `string` | `""` | no |

Diff for: main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ locals {
7676
aws_region = var.aws_region
7777
gitlab_url = var.runners_gitlab_url
7878
gitlab_clone_url = var.runners_clone_url
79+
runners_extra_hosts = var.runners_extra_hosts
7980
runners_vpc_id = var.vpc_id
8081
runners_subnet_id = length(var.subnet_id) > 0 ? var.subnet_id : var.subnet_id_runners
8182
runners_aws_zone = data.aws_availability_zone.runners.name_suffix
@@ -390,6 +391,8 @@ resource "aws_iam_role_policy_attachment" "user_defined_policies" {
390391
### Policy for the docker machine instance to access cache
391392
################################################################################
392393
resource "aws_iam_role_policy_attachment" "docker_machine_cache_instance" {
394+
count = var.cache_bucket["create"] || length(lookup(var.cache_bucket, "policy", "")) > 0 ? 1 : 0
395+
393396
role = aws_iam_role.instance.name
394397
policy_arn = local.bucket_policy
395398
}

Diff for: template/runner-config.tpl

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ listen_address = "${prometheus_listen_address}"
2323
privileged = ${runners_privileged}
2424
disable_cache = ${runners_disable_cache}
2525
volumes = ["/cache"${runners_additional_volumes}]
26+
extra_hosts = ${jsonencode(runners_extra_hosts)}
2627
shm_size = ${runners_shm_size}
2728
pull_policy = "${runners_pull_policy}"
2829
runtime = "${runners_docker_runtime}"

Diff for: variables.tf

+12-1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ variable "runners_additional_volumes" {
213213
default = []
214214
}
215215

216+
variable "runners_extra_hosts" {
217+
description = "Extra hosts that will be used in the runner config.toml, e.g other-host:127.0.0.1"
218+
type = list(any)
219+
default = []
220+
}
221+
216222
variable "runners_shm_size" {
217223
description = "shm_size for the runners, will be used in the runner config.toml"
218224
type = number
@@ -389,7 +395,7 @@ variable "cache_shared" {
389395
variable "gitlab_runner_version" {
390396
description = "Version of the [GitLab runner](https://gitlab.com/gitlab-org/gitlab-runner/-/releases)."
391397
type = string
392-
default = "14.8.3"
398+
default = "15.3.0"
393399
}
394400

395401
variable "enable_ping" {
@@ -584,6 +590,11 @@ variable "overrides" {
584590
name_runner_agent_instance = ""
585591
name_docker_machine_runners = ""
586592
}
593+
594+
validation {
595+
condition = length(var.overrides["name_docker_machine_runners"]) <= 28
596+
error_message = "Maximum length for name_docker_machine_runners is 28 characters!"
597+
}
587598
}
588599

589600
variable "cache_bucket" {

0 commit comments

Comments
 (0)