You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added an S3 cache, so that the buildspec.yml can use cache and dynamic environment vars. (#16)
* Added s3 caching option, with autodelete cache
* Added s3 caching option, with autodelete cache
* Added s3 caching option, with autodelete cache
* fixed error on conditional cache usage
* Updated the cache_enabled option for clarity
Added the ability to dynamically add environment variables.
Set the s3 bucket to only create if the cache is enabled
Added a null provider verion to remove the warning.
Added a random provider with version to remove warning.
Added a random string generator to append to bucket names to add uniqueness, lowering the chance of bucket name conflicts
* removed build harness file
* updated the environment_variables to use a default list containing a map. When it was empty, it caused an error
* Fixed formatting for lint
* updated variable description
* fixed format
* fixed source of label module
* fixed source of label module
* fixed source of label module
* set label to use terraform-null-label
* Switched to a tagged release of terraform-terraform-label
* added git:: to source
* moved provider section out of module, and added a section to README to make users aware of the providers used, nd how to squash the warning
| buildspec | "" | (Optional) `buildspec` declaration to use for building the project |
44
-
| privileged_mode | "" | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the `CodeBuild` instance. Used when building Docker images |
45
-
| aws_region | "" | (Optional) AWS Region, _e.g._`us-east-1`. Used as `CodeBuild` ENV variable when building Docker images |
46
-
| aws_account_id | "" | (Optional) AWS Account ID. Used as `CodeBuild` ENV variable when building Docker images |
47
-
| image_repo_name | "UNSET" | (Optional) ECR repository name to store the Docker image built by this module. Used as `CodeBuild` ENV variable when building Docker images |
48
-
| image_tag | "latest" | (Optional) Docker image tag in the ECR repository, _e.g._`latest`. Used as `CodeBuild` ENV variable when building Docker images |
| build_image | aws/codebuild/docker:1.12.1 | Docker image for build environment, _e.g._`aws/codebuild/docker:1.12.1` or `aws/codebuild/eb-nodejs-6.10.0-amazonlinux-64:4.0.0` (use `aws codebuild list-curated-environment-images` to get full list) |
| buildspec | "" | (Optional) `buildspec` declaration to use for building the project |
72
+
| privileged_mode | "" | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the `CodeBuild` instance. Used when building Docker images |
73
+
| aws_region | "" | (Optional) AWS Region, _e.g._`us-east-1`. Used as `CodeBuild` ENV variable when building Docker images |
74
+
| aws_account_id | "" | (Optional) AWS Account ID. Used as `CodeBuild` ENV variable when building Docker images |
75
+
| image_repo_name | "UNSET" | (Optional) ECR repository name to store the Docker image built by this module. Used as `CodeBuild` ENV variable when building Docker images |
76
+
| image_tag | "latest" | (Optional) Docker image tag in the ECR repository, _e.g._`latest`. Used as `CodeBuild` ENV variable when building Docker images |
| cache_enabled | "true" | (Optional) Creates an S3 bucket, with permissions which allow [CodeBuild to store cache objects](https://aws.amazon.com/blogs/devops/how-to-enable-caching-for-aws-codebuild/)|
79
+
| cache_expiration_days | "7" | (Optional) Sets S3 policy to expire objects after X days. |
80
+
| cache_bucket_suffix_enabled | "true" | (Optional) Generates an optional 13 character bucket suffix, to help ensure that the bucket will be globally unique |
81
+
| environment_variables |[]| (Optional) A list of maps that contain both "name" and "value" keys for adding additional environment variables at build time |
Copy file name to clipboardExpand all lines: variables.tf
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,32 @@ variable "name" {
10
10
default="codebuild"
11
11
}
12
12
13
+
variable"environment_variables" {
14
+
type="list"
15
+
16
+
default=[{
17
+
"name"="NO_ADDITIONAL_BUILD_VARS"
18
+
"value"="TRUE"
19
+
}]
20
+
21
+
description="A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build."
22
+
}
23
+
24
+
variable"cache_enabled" {
25
+
default="true"
26
+
description="If cache_enabled is true, create an S3 bucket for storing codebuild cache inside"
27
+
}
28
+
29
+
variable"cache_expiration_days" {
30
+
default="7"
31
+
description="How many days should the build cache be kept."
32
+
}
33
+
34
+
variable"cache_bucket_suffix_enabled" {
35
+
default="true"
36
+
description="The cache bucket generates a random 13 character string to generate a unique bucket name. If set to false it uses terraform-null-label's id value"
37
+
}
38
+
13
39
variable"build_image" {
14
40
default="aws/codebuild/docker:1.12.1"
15
41
description="Docker image for build environment, e.g. 'aws/codebuild/docker:1.12.1' or 'aws/codebuild/eb-nodejs-6.10.0-amazonlinux-64:4.0.0'. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html"
0 commit comments