-
Notifications
You must be signed in to change notification settings - Fork 26
/
variables.tf
456 lines (385 loc) · 15.6 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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# General vars
variable "name" {
description = "The projects name."
type = string
}
variable "badge_enabled" {
description = "Generates a publicly-accessible URL for the projects build badge. Available as badge_url attribute when enabled."
type = bool
default = false
}
variable "build_timeout" {
description = "How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed.The default is 60 minutes."
type = number
default = 60
}
variable "queued_timeout" {
description = "How long in minutes, from 5 to 480 (8 hours), a build is allowed to be queued before it times out.The default is 8 hours."
type = number
default = 480
}
variable "description" {
description = "A short description of the project."
type = string
default = null
}
variable "encryption_key" {
description = "The AWS Key Management Service (AWS KMS) customer master key (CMK) to be used for encrypting the build project's build output artifacts."
type = string
default = null
}
variable "codebuild_source_version" {
description = "A version of the build input to be built for this project. If not specified, the latest version is used."
type = string
default = null
}
# Artifacts
variable "artifacts" {
description = "Information about the project's build output artifacts."
type = any
default = {}
}
variable "artifacts_type" {
description = "The build output artifact's type. Valid values for this parameter are: `CODEPIPELINE`, `NO_ARTIFACTS` or `S3`."
type = string
default = "CODEPIPELINE"
}
variable "artifacts_artifact_identifier" {
description = "The artifact identifier. Must be the same specified inside AWS CodeBuild buildspec."
type = string
default = null
}
variable "artifacts_encryption_disabled" {
description = "If set to true, output artifacts will not be encrypted. If `type` is set to `NO_ARTIFACTS` then this value will be ignored."
type = bool
default = false
}
variable "artifacts_override_artifact_name" {
description = "If set to true, a name specified in the build spec file overrides the artifact name."
type = bool
default = false
}
variable "artifacts_location" {
description = "Information about the build output artifact location. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS` then this value will be ignored. If `type` is set to `S3`, this is the name of the output bucket."
type = string
default = null
}
variable "artifacts_name" {
description = "The name of the project. If `type` is set to `S3`, this is the name of the output artifact object."
type = string
default = null
}
variable "artifacts_namespace_type" {
description = "The namespace to use in storing build artifacts. If `type` is set to `S3`, then valid values for this parameter are: `BUILD_ID` or `NONE`."
type = string
default = null
}
variable "artifacts_packaging" {
description = "The type of build output artifact to create. If `type` is set to `S3`, valid values for this parameter are: `NONE` or `ZIP`"
type = string
default = null
}
variable "artifacts_path" {
description = "If `type` is set to `S3`, this is the path to the output artifact"
type = string
default = ""
}
# Cache
variable "cache" {
description = "Information about the cache storage for the project."
type = any
default = {}
}
variable "cache_type" {
description = "The type of storage that will be used for the AWS CodeBuild project cache. Valid values: `NO_CACHE`, `LOCAL`, and `S3`."
type = string
default = "NO_CACHE"
}
variable "cache_location" {
description = "The location where the AWS CodeBuild project stores cached resources. For type S3 the value must be a valid S3 bucket name/prefix. (Required when cache `type` is `S3`)"
type = string
default = null
}
variable "cache_modes" {
description = "Specifies settings that AWS CodeBuild uses to store and reuse build dependencies. Valid values: `LOCAL_SOURCE_CACHE`, `LOCAL_DOCKER_LAYER_CACHE`, and `LOCAL_CUSTOM_CACHE`. (Required when cache type is `LOCAL`)"
type = list(any)
default = []
}
# Environment
variable "environment" {
description = "Information about the project's build environment."
type = any
default = {}
}
variable "environment_compute_type" {
description = "Information about the compute resources the build project will use. Available values for this parameter are: `BUILD_GENERAL1_SMALL`, `BUILD_GENERAL1_MEDIUM`, `BUILD_GENERAL1_LARGE` or `BUILD_GENERAL1_2XLARGE`. `BUILD_GENERAL1_SMALL` is only valid if type is set to `LINUX_CONTAINER`. When type is set to `LINUX_GPU_CONTAINER`, compute_type need to be `BUILD_GENERAL1_LARGE`."
type = string
default = "BUILD_GENERAL1_MEDIUM"
}
variable "environment_image" {
description = "The Docker image to use for this build project. Valid values include Docker images provided by CodeBuild (e.g `aws/codebuild/standard:2.0`), Docker Hub images (e.g. `hashicorp/terraform:latest`), and full Docker repository URIs such as those for ECR (e.g. `137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest`)"
type = string
default = "aws/codebuild/standard:2.0"
}
variable "environment_type" {
description = "The type of build environment to use for related builds. Available values are: `LINUX_CONTAINER`, `LINUX_GPU_CONTAINER`, `WINDOWS_CONTAINER` or `ARM_CONTAINER`."
type = string
default = "LINUX_CONTAINER"
}
variable "environment_image_pull_credentials_type" {
description = "The type of credentials AWS CodeBuild uses to pull images in your build. Available values for this parameter are `CODEBUILD` or `SERVICE_ROLE`. When you use a cross-account or private registry image, you must use SERVICE_ROLE credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD credentials."
type = string
default = "CODEBUILD"
}
variable "environment_variables" {
description = "A list of sets of environment variables to make available to builds for this build project."
type = list(any)
default = []
}
variable "environment_privileged_mode" {
description = "If set to true, enables running the Docker daemon inside a Docker container."
type = bool
default = false
}
variable "environment_certificate" {
description = "The ARN of the S3 bucket, path prefix and object key that contains the PEM-encoded certificate."
type = string
default = null
}
variable "environment_registry_credential" {
description = "Information about credentials for access to a private Docker registry. Registry Credential config blocks are documented below."
type = map(any)
default = {}
}
# Logs
variable "cloudwatch_logs" {
description = "Configuration for the builds to store log data to CloudWatch."
type = any
default = {}
}
variable "cloudwatch_logs_status" {
description = "Current status of logs in CloudWatch Logs for a build project. Valid values: `ENABLED`, `DISABLED."
type = string
default = "ENABLED"
}
variable "cloudwatch_logs_group_name" {
description = "The group name of the logs in CloudWatch Logs."
type = string
default = null
}
variable "cloudwatch_logs_stream_name" {
description = "The stream name of the logs in CloudWatch Logs."
type = string
default = null
}
variable "s3_logs" {
description = "Configuration for the builds to store log data to S3."
type = any
default = {}
}
variable "s3_logs_status" {
description = "Current status of logs in S3 for a build project. Valid values: `ENABLED`, `DISABLED."
type = string
default = "DISABLED"
}
variable "s3_logs_location" {
description = "The name of the S3 bucket and the path prefix for S3 logs. Must be set if status is ENABLED, otherwise it must be empty."
type = string
default = null
}
variable "s3_logs_encryption_disabled" {
description = "Set to true if you do not want S3 logs encrypted."
type = string
default = true
}
# Source
variable "codebuild_source" {
description = "Information about the project's input source code."
type = any
default = {}
}
variable "codebuild_source_type" {
description = "The type of repository that contains the source code to be built. Valid values for this parameter are: `CODECOMMIT`, `CODEPIPELINE`, `GITHUB`, `GITHUB_ENTERPRISE`, `BITBUCKET`, `S3` or `NO_SOURCE`."
type = string
default = "CODEPIPELINE"
}
variable "codebuild_source_buildspec" {
description = "The build spec declaration to use for this build project's related builds. This must be set when type is iNO_SOURCE`"
type = string
default = null
}
variable "codebuild_source_git_clone_depth" {
description = "Information about the Git submodules configuration for an AWS CodeBuild build project. Git submodules config blocks are documented below. This option is only valid when the type is `CODECOMMIT`."
type = number
default = 0
}
variable "codebuild_source_insecure_ssl" {
description = "Ignore SSL warnings when connecting to source control."
type = bool
default = false
}
variable "codebuild_source_location" {
description = "The location of the source code from git or s3."
type = string
default = null
}
variable "codebuild_source_report_build_status" {
description = "Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the type is `BITBUCKET` or `GITHUB`."
type = bool
default = false
}
variable "codebuild_source_auth" {
description = "Information about the authorization settings for AWS CodeBuild to access the source code to be built."
type = map(any)
default = {}
}
variable "codebuild_source_auth_type" {
description = "The authorization type to use. The only valid value is OAUTH"
type = string
default = "OAUTH"
}
variable "codebuild_source_auth_resource" {
description = "The resource value that applies to the specified authorization type."
type = string
default = null
}
variable "codebuild_source_git_submodules_config" {
description = "Information about the Git submodules configuration for an AWS CodeBuild build project. Git submodules config blocks are documented below. This option is only valid when the type is `CODECOMMIT`."
type = map(any)
default = {}
}
variable "codebuild_source_git_submodules_config_fetch_submodules" {
description = "If set to true, fetches Git submodules for the AWS CodeBuild build project."
type = bool
default = true
}
# Secondary Source
variable "codebuild_secondary_sources" {
description = <<-EOF
Information about the project's secondary sources code. See the related codebuild source objects for descriptions of each parameter.
The parameter `source_identifier` is the name of the directory to clone the secondary source into as a sibling to the primary source code directory.
If this variable is omitted, no secondary sources are created.
eg:
```
codebuild_secondary_sources = [
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-1.git"
source_identifier = "my_awesome_project1"
},
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-2.git"
git_clone_depth = 1
source_identifier = "my_awesome_project2"
report_build_status = true
insecure_ssl = true
}
]
```
EOF
type = any
default = []
}
variable "codebuild_secondary_source_type" {
description = "The type of repository that contains the secondary source code to be built. Valid values for this parameter are: `CODECOMMIT`, `CODEPIPELINE`, `GITHUB`, `GITHUB_ENTERPRISE`, `BITBUCKET`, `S3` or `NO_SOURCE`."
type = string
default = "CODEPIPELINE"
}
variable "codebuild_secondary_source_buildspec" {
description = "The build spec declaration to use for this build project's related builds. Optional"
type = string
default = null
}
variable "codebuild_secondary_source_git_clone_depth" {
description = "Information about the Git submodules configuration for an AWS CodeBuild build project. Git submodules config blocks are documented below. This option is only valid when the type is `CODECOMMIT`."
type = number
default = 0
}
variable "codebuild_secondary_source_insecure_ssl" {
description = "Ignore SSL warnings when connecting to source control."
type = bool
default = false
}
variable "codebuild_secondary_source_location" {
description = "The location of the source code from git or s3."
type = string
default = null
}
variable "codebuild_secondary_source_report_build_status" {
description = "Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the type is `BITBUCKET` or `GITHUB`."
type = bool
default = false
}
variable "codebuild_secondary_source_auth" {
description = "Information about the authorization settings for AWS CodeBuild to access the source code to be built."
type = map(any)
default = {}
}
variable "codebuild_secondary_source_auth_type" {
description = "The authorization type to use. The only valid value is OAUTH"
type = string
default = "OAUTH"
}
variable "codebuild_secondary_source_auth_resource" {
description = "The resource value that applies to the specified authorization type."
type = string
default = null
}
variable "codebuild_secondary_source_git_submodules_config" {
description = "Information about the Git submodules configuration for an AWS CodeBuild build project. Git submodules config blocks are documented below. This option is only valid when the type is `CODECOMMIT`."
type = map(any)
default = {}
}
variable "codebuild_secondary_source_identifier" {
description = "The name of a folder named that the source will be checked out into inside the AWS CodeBuild source directory"
type = string
default = null
}
variable "codebuild_secondary_source_git_submodules_config_fetch_submodules" {
description = "If set to true, fetches Git submodules for the AWS CodeBuild build project."
type = bool
default = true
}
# VPC Config
variable "vpc_config" {
description = "Configuration for the builds to run inside a VPC."
type = any
default = {}
}
variable "vpc_config_vpc_id" {
description = "The ID of the VPC within which to run builds."
type = string
default = null
}
variable "vpc_config_subnets" {
description = "The subnet IDs within which to run builds."
type = list(string)
default = []
}
variable "vpc_config_security_group_ids" {
description = "The security group IDs to assign to running builds."
type = list(string)
default = []
}
# Tags
variable "tags" {
description = "A mapping of tags to assign to the resource."
type = map(string)
default = {}
}
variable "create_default_service_role" {
description = "Should the default service role be created?"
type = bool
default = true
}
variable "service_role_arn" {
description = "A predefined service role to be used"
type = string
default = null
}
variable "concurrent_build_limit" {
description = "Specify a maximum number of concurrent builds for the project."
type = number
default = 1
}