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
Add environment_variables for building Docker images and pushing to ECR (#7)
* Add `environment_variables` for building `Docker` images and pushing to `AWS ECR`
* Add description to `variables.tf`
* Update `README.md`
* Update `README.md`
* Update `variables.tf`
* Use `data.aws_caller_identity.current.account_id` if `var.aws_account_id` is not provided
* Use `data.aws_region.current.name` if `var.aws_region` is not provided
* Rename `data sources` to `default`
* Remove `default` from `variable "image"`
* Rename `image` to `build_image`
* Update `README.md`
* Rename `instance_size` to `build_compute_type`
* Remove `S3` policy resource from `README.md` since it's not `CodeBuild` specific
* Update description
* Add `default` and `description` for `variable "build_image"`
| buildspec | "" | (Optional) `buildspec` declaration to use for building the project |
45
+
| 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 |
46
+
| aws_region | "" | (Optional) AWS Region, _e.g._`us-east-1`. Used as `CodeBuild` ENV variable when building Docker images |
47
+
| aws_account_id | "" | (Optional) AWS Account ID. Used as `CodeBuild` ENV variable when building Docker images |
48
+
| image_repo_name | "" | (Optional) ECR repository name to store the Docker image built by this module. Used as `CodeBuild` ENV variable when building Docker images |
49
+
| image_tag | "" | (Optional) Docker image tag in the ECR repository, _e.g._`latest`. Used as `CodeBuild` ENV variable when building Docker images |
Copy file name to clipboardExpand all lines: variables.tf
+33-3Lines changed: 33 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,12 @@ variable "name" {
10
10
default="codebuild"
11
11
}
12
12
13
-
variable"image" {
14
-
default="alpine"
13
+
variable"build_image" {
14
+
default="aws/codebuild/docker:1.12.1"
15
+
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"
15
16
}
16
17
17
-
variable"instance_size" {
18
+
variable"build_compute_type" {
18
19
default="BUILD_GENERAL1_SMALL"
19
20
}
20
21
@@ -37,3 +38,32 @@ variable "tags" {
37
38
type="map"
38
39
default={}
39
40
}
41
+
42
+
variable"privileged_mode" {
43
+
default=false
44
+
description="(Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images"
45
+
}
46
+
47
+
variable"aws_region" {
48
+
type="string"
49
+
default=""
50
+
description="(Optional) AWS Region, e.g. us-east-1. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html"
51
+
}
52
+
53
+
variable"aws_account_id" {
54
+
type="string"
55
+
default=""
56
+
description="(Optional) AWS Account ID. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html"
57
+
}
58
+
59
+
variable"image_repo_name" {
60
+
type="string"
61
+
default=""
62
+
description="(Optional) ECR repository name to store the Docker image built by this module. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html"
63
+
}
64
+
65
+
variable"image_tag" {
66
+
type="string"
67
+
default=""
68
+
description="(Optional) Docker image tag in the ECR repository, e.g. 'latest'. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html"
0 commit comments