File tree 7 files changed +402
-224
lines changed
7 files changed +402
-224
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -33,10 +33,9 @@ module "runner" {
33
33
aws_region = var. aws_region
34
34
environment = var. environment
35
35
36
- vpc_id = module. vpc . vpc_id
37
- subnet_ids_gitlab_runner = module. vpc . private_subnets
38
- subnet_id_runners = element (module. vpc . private_subnets , 0 )
39
- metrics_autoscaling = [" GroupDesiredCapacity" , " GroupInServiceCapacity" ]
36
+ vpc_id = module. vpc . vpc_id
37
+ subnet_id = element (module. vpc . private_subnets , 0 )
38
+ metrics_autoscaling = [" GroupDesiredCapacity" , " GroupInServiceCapacity" ]
40
39
41
40
runners_name = var. runner_name
42
41
runners_gitlab_url = var. gitlab_url
Original file line number Diff line number Diff line change @@ -31,9 +31,8 @@ module "runner" {
31
31
docker_machine_security_group_description = " Custom description for docker-machine"
32
32
gitlab_runner_security_group_description = " Custom description for gitlab-runner"
33
33
34
- vpc_id = module. vpc . vpc_id
35
- subnet_ids_gitlab_runner = module. vpc . public_subnets
36
- subnet_id_runners = element (module. vpc . public_subnets , 0 )
34
+ vpc_id = module. vpc . vpc_id
35
+ subnet_id = element (module. vpc . public_subnets , 0 )
37
36
38
37
runners_executor = " docker"
39
38
runners_name = var. runner_name
Original file line number Diff line number Diff line change @@ -29,9 +29,8 @@ module "runner" {
29
29
aws_region = var. aws_region
30
30
environment = var. environment
31
31
32
- vpc_id = module. vpc . vpc_id
33
- subnet_ids_gitlab_runner = module. vpc . private_subnets
34
- subnet_id_runners = element (module. vpc . private_subnets , 0 )
32
+ vpc_id = module. vpc . vpc_id
33
+ subnet_id = element (module. vpc . private_subnets , 0 )
35
34
36
35
runners_name = var. runner_name
37
36
runners_gitlab_url = var. gitlab_url
Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ module "runner" {
32
32
33
33
runners_use_private_address = false
34
34
35
- vpc_id = module. vpc . vpc_id
36
- subnet_ids_gitlab_runner = module. vpc . public_subnets
37
- subnet_id_runners = element (module. vpc . public_subnets , 0 )
35
+ vpc_id = module. vpc . vpc_id
36
+ subnet_id = element (module. vpc . public_subnets , 0 )
38
37
39
38
docker_machine_spot_price_bid = " on-demand-price"
40
39
Original file line number Diff line number Diff line change 1
1
data "aws_caller_identity" "current" {}
2
2
3
3
data "aws_subnet" "runners" {
4
- id = var. subnet_id_runners
4
+ id = length (var . subnet_id ) > 0 ? var . subnet_id : var. subnet_id_runners
5
5
}
6
6
7
7
data "aws_availability_zone" "runners" {
@@ -99,7 +99,7 @@ locals {
99
99
aws_region = var.aws_region
100
100
gitlab_url = var.runners_gitlab_url
101
101
runners_vpc_id = var.vpc_id
102
- runners_subnet_id = var.subnet_id_runners
102
+ runners_subnet_id = length (var . subnet_id ) > 0 ? var.subnet_id : var.subnet_id_runners
103
103
runners_aws_zone = data.aws_availability_zone.runners.name_suffix
104
104
runners_instance_type = var.docker_machine_instance_type
105
105
runners_spot_price_bid = var.docker_machine_spot_price_bid == " on-demand-price" ? " " : var.docker_machine_spot_price_bid
@@ -174,7 +174,7 @@ data "aws_ami" "docker-machine" {
174
174
175
175
resource "aws_autoscaling_group" "gitlab_runner_instance" {
176
176
name = var. enable_asg_recreation ? " ${ aws_launch_template . gitlab_runner_instance . name } -asg" : " ${ var . environment } -as-group"
177
- vpc_zone_identifier = var. subnet_ids_gitlab_runner
177
+ vpc_zone_identifier = length (var . subnet_id ) > 0 ? [ var . subnet_id ] : var. subnet_ids_gitlab_runner
178
178
min_size = " 1"
179
179
max_size = " 1"
180
180
desired_capacity = " 1"
Original file line number Diff line number Diff line change @@ -19,14 +19,10 @@ variable "vpc_id" {
19
19
type = string
20
20
}
21
21
22
- variable "subnet_id_runners " {
23
- description = " List of subnets used for hosting the gitlab-runners ."
22
+ variable "subnet_id " {
23
+ description = " Subnet id used for the runner and executors. Must belong to the VPC specified above ."
24
24
type = string
25
- }
26
-
27
- variable "subnet_ids_gitlab_runner" {
28
- description = " Subnet used for hosting the GitLab runner."
29
- type = list (string )
25
+ default = " " # TODO remove as soon as subnet_id_runners and subnet_ids_gitlab_runner are gone. Variable is mandatory now.
30
26
}
31
27
32
28
variable "extra_security_group_ids_runner_agent" {
@@ -726,3 +722,15 @@ variable "docker_machine_egress_rules" {
726
722
description = " Allow all egress traffic for docker machine build runners"
727
723
}]
728
724
}
725
+
726
+ variable "subnet_id_runners" {
727
+ description = " Deprecated! Use subnet_id instead. List of subnets used for hosting the gitlab-runners."
728
+ type = string
729
+ default = " "
730
+ }
731
+
732
+ variable "subnet_ids_gitlab_runner" {
733
+ description = " Deprecated! Use subnet_id instead. Subnet used for hosting the GitLab runner."
734
+ type = list (string )
735
+ default = []
736
+ }
You can’t perform that action at this time.
0 commit comments