forked from msvechla/terraform-aws-gitlab-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
274 lines (224 loc) · 7.54 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
variable "aws_region" {
description = "AWS region."
type = "string"
}
variable "aws_zone" {
description = "AWS availability zone (typically 'a', 'b', or 'c')."
type = "string"
default = "a"
}
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_ids_gitlab_runner" {
description = "Subnet used for hosting the gitlab-runner."
type = "list"
}
variable "instance_type" {
description = "Instance type used for the gitlab-runner."
type = "string"
default = "t2.micro"
}
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.1"
}
variable "runners_name" {
description = "Name of the runner, will be used in the runner config.toml"
type = "string"
}
variable "runners_executor" {
description = "The executor to use. Currently supports docker+machine or docker"
type = "string"
default = "docker+machine"
}
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 "create_runners_iam_instance_profile" {
default = true
}
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_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 "cache_shared" {
description = "Enables cache sharing between runners, false by default."
type = "string"
default = "false"
}
variable "gitlab_runner_version" {
description = "Version for the gitlab runner."
type = "string"
default = "11.8.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
}
variable "docker_machine_options" {
description = "Additional to set options for docker machine. Each element of the list should be key and value. E.g. '[\"amazonec2-zone=a\"]'"
type = "list"
default = []
}
variable "instance_role_json" {
description = "Instance role json for the runner agent ec2 instance to override the default."
type = "string"
default = ""
}
variable "instance_role_runner_json" {
description = "Instance role json for the docker machine runners to override the default."
type = "string"
default = ""
}
variable "ami_filter" {
description = "AMI filter to select the AMI used to host the gitlab runner agent. By default the pattern `amzn-ami-hvm-2018.03*-x86_64-ebs` is used for the name. Currently Amazon Linux 2 `amzn2-ami-hvm-2.0.????????-x86_64-ebs` looks *not* working for this configuration."
type = "list"
default = [{
name = "name"
values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
}]
}
variable "ami_owners" {
description = "A list of owners used to select the AMI for the instance."
type = "list"
default = ["amazon"]
}