forked from cattle-ops/terraform-aws-gitlab-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
251 lines (208 loc) · 7.11 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
variable "aws_region" {
description = "AWS region."
type = "string"
}
variable "environment" {
description = "A name that identifies the environment, will used as prefix and for tagging."
type = "string"
}
variable "vpc_id" {
description = "The VPC that is used for the instances."
type = "string"
}
variable "subnet_id_runners" {
description = "Subnet used to hosts the docker-machine runners."
type = "string"
}
variable "subnet_id_gitlab_runner" {
description = "Subnet used for hosting the gitlab-runner."
type = "string"
}
variable "instance_type" {
description = "Instance type used for the gitlab-runner."
type = "string"
default = "t2.micro"
}
# list with amazon linux optimized images per region
# HVM (SSD) EBS-Backed 64-bit
# Amazon Linux AMI 2018.03 was released on 2018-06-28 https://aws.amazon.com/amazon-linux-ami/
variable "amazon_optimized_amis" {
description = "AMI map per region-zone for the gitlab-runner instance AMI."
type = "map"
default = {
us-east-1 = "ami-97785bed" # N. Virginia
us-east-2 = "ami-f63b1193" # Ohio
us-west-1 = "ami-824c4ee2" # N. California
us-west-2 = "ami-f2d3638a" # Oregon
eu-west-1 = "ami-d834aba1" # Ireland
eu-west-2 = "ami-403e2524" # London
eu-central-1 = "ami-5652ce39" # Frankfurt
eu-central-2 = "ami-8ee056f3" # Paris
ap-northeast-1 = "ami-ceafcba8" # Tokyo
ap-northeast-2 = "ami-863090e8" # Seoel
ap-southeast-1 = "ami-68097514" # Singapore
ap-southeast-2 = "ami-942dd1f6" # Sydney
ap-south-1 = "ami-531a4c3c" # Mumbai
ca-central-1 = "ami-a954d1cd" # Canada
sa-east-1 = "ami-84175ae8" # São Paulo
cn-north-1 = "ami-cb19c4a6" # Beijing
}
}
variable "ssh_public_key" {
description = "Public SSH key used for the gitlab-runner ec2 instance."
type = "string"
}
variable "docker_machine_instance_type" {
description = "Instance type used for the instances hosting docker-machine."
default = "m4.large"
}
variable "docker_machine_spot_price_bid" {
description = "Spot price bid."
default = "0.04"
}
variable "docker_machine_version" {
description = "Version of docker-machine."
default = "0.16.0"
}
variable "runners_name" {
description = "Name of the runner, will be used in the runner config.toml"
type = "string"
}
variable "runners_gitlab_url" {
description = "URL of the gitlab instance to connect to."
type = "string"
}
variable "runners_token" {
description = "Token for the runner, will be used in the runner config.toml"
type = "string"
}
variable "runners_limit" {
description = "Limit for the runners, will be used in the runner config.toml"
default = 0
}
variable "runners_concurrent" {
description = "Concurrent value for the runners, will be used in the runner config.toml"
default = 10
}
variable "runners_idle_time" {
description = "Idle time of the runners, will be used in the runner config.toml"
default = 600
}
variable "runners_idle_count" {
description = "Idle count of the runners, will be used in the runner config.toml"
default = 0
}
variable "runners_image" {
description = "Image to run builds, will be used in the runner config.toml"
type = "string"
default = "docker:18.03.1-ce"
}
variable "runners_privilled" {
description = "Runners will run in privilled mode, will be used in the runner config.toml"
type = "string"
default = "true"
}
variable "runners_monitoring" {
description = "Enable detailed cloudwatch monitoring for spot instances."
default = false
}
variable "runners_off_peak_timezone" {
description = "Off peak idle time zone of the runners, will be used in the runner config.toml."
default = ""
}
variable "runners_off_peak_idle_count" {
description = "Off peak idle count of the runners, will be used in the runner config.toml."
default = 0
}
variable "runners_off_peak_idle_time" {
description = "Off peak idle time of the runners, will be used in the runner config.toml."
default = 0
}
variable "runners_off_peak_periods" {
description = "Off peak periods of the runners, will be used in the runner config.toml."
type = "string"
default = ""
}
variable "runners_root_size" {
description = "Runnner instance root size in GB."
default = 16
}
variable "runners_iam_instance_profile_name" {
description = "IAM instance profile name of the runners, will be used in the runner config.toml"
type = "string"
default = ""
}
variable "runners_pre_build_script" {
description = "Script to execute in the pipeline just before the build, will be used in the runner config.toml"
type = "string"
default = ""
}
variable "runners_post_build_script" {
description = "Commands to be executed on the Runner just after executing the build, but before executing after_script. "
type = "string"
default = ""
}
variable "runners_pre_clone_script" {
description = "Commands to be executed on the Runner before cloning the Git repository. this can be used to adjust the Git client configuration first, for example. "
type = "string"
default = ""
}
variable "runners_request_concurrency" {
description = "Limit number of concurrent requests for new jobs from GitLab (default 1)"
default = "1"
}
variable "runners_output_limit" {
description = "Set maximum build log size in kilobytes, by default set to 4096 (4MB)"
default = "4096"
}
variable "userdata_pre_install" {
description = "User-data script snippet to insert before gitlab-runner install"
type = "string"
default = ""
}
variable "userdata_post_install" {
description = "User-data script snippet to insert after gitlab-runner install"
type = "string"
default = ""
}
variable "runners_use_private_address" {
description = "Restrict runners to use only private address"
default = "true"
}
variable "docker_machine_user" {
description = "User name for the user to create spot instances to host docker-machine."
type = "string"
default = "docker-machine"
}
variable "cache_user" {
description = "User name of the user to create to write and read to the s3 cache."
type = "string"
default = "cache_user"
}
variable "cache_bucket_prefix" {
description = "Prefix for s3 cache bucket name."
type = "string"
default = ""
}
variable "cache_expiration_days" {
description = "Number of days before cache objects expires."
default = 1
}
variable "gitlab_runner_version" {
description = "Version for the gitlab runner."
type = "string"
default = "11.6.0"
}
variable "enable_cloudwatch_logging" {
description = "Enable or disable the CloudWatch logging."
default = 1
}
variable "tags" {
type = "map"
description = "Map of tags that will be added to created resources. By default resources will be taggen with name and environemnt."
default = {}
}
variable "allow_iam_service_linked_role_creation" {
description = "Attach policy to runner instance to create service linked roles."
default = true
}