Skip to content

Commit 9a5a34f

Browse files
Add requested inputs (#111)
* Add file_system_locations * Auto Format * Add encryption_key * Auto Format * Add build_image_pull_credentials_type * Auto Format * Add s3_cache_bucket_name * Auto Format * Update main.tf Co-authored-by: cloudpossebot <[email protected]>
1 parent bef1485 commit 9a5a34f

File tree

8 files changed

+160
-89
lines changed

8 files changed

+160
-89
lines changed

.github/renovate.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
":preserveSemverRanges"
55
],
66
"labels": ["auto-update"],
7+
"dependencyDashboardAutoclose": true,
78
"enabledManagers": ["terraform"],
89
"terraform": {
910
"ignorePaths": ["**/context.tf", "examples/**"]
1011
}
1112
}
12-

README.md

+46-38
Original file line numberDiff line numberDiff line change
@@ -97,43 +97,47 @@ Include this module in your existing terraform code:
9797

9898
```hcl
9999
module "build" {
100-
source = "cloudposse/codebuild/aws"
101-
# Cloud Posse recommends pinning every module to a specific version
102-
# version = "x.x.x"
103-
namespace = "eg"
104-
stage = "staging"
105-
name = "app"
106-
107-
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
108-
build_image = "aws/codebuild/standard:2.0"
109-
build_compute_type = "BUILD_GENERAL1_SMALL"
110-
build_timeout = 60
111-
112-
# These attributes are optional, used as ENV variables when building Docker images and pushing them to ECR
113-
# For more info:
114-
# http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
115-
# https://www.terraform.io/docs/providers/aws/r/codebuild_project.html
116-
117-
privileged_mode = true
118-
aws_region = "us-east-1"
119-
aws_account_id = "xxxxxxxxxx"
120-
image_repo_name = "ecr-repo-name"
121-
image_tag = "latest"
122-
123-
# Optional extra environment variables
124-
environment_variables = [{
125-
name = "JENKINS_URL"
126-
value = "https://jenkins.example.com"
127-
},
128-
{
129-
name = "COMPANY_NAME"
130-
value = "Amazon"
131-
},
132-
{
133-
name = "TIME_ZONE"
134-
value = "Pacific/Auckland"
135-
136-
}]
100+
source = "cloudposse/codebuild/aws"
101+
# Cloud Posse recommends pinning every module to a specific version
102+
# version = "x.x.x"
103+
namespace = "eg"
104+
stage = "staging"
105+
name = "app"
106+
107+
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
108+
build_image = "aws/codebuild/standard:2.0"
109+
build_compute_type = "BUILD_GENERAL1_SMALL"
110+
build_timeout = 60
111+
112+
# These attributes are optional, used as ENV variables when building Docker images and pushing them to ECR
113+
# For more info:
114+
# http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
115+
# https://www.terraform.io/docs/providers/aws/r/codebuild_project.html
116+
117+
privileged_mode = true
118+
aws_region = "us-east-1"
119+
aws_account_id = "xxxxxxxxxx"
120+
image_repo_name = "ecr-repo-name"
121+
image_tag = "latest"
122+
123+
# Optional extra environment variables
124+
environment_variables = [
125+
{
126+
name = "JENKINS_URL"
127+
value = "https://jenkins.example.com"
128+
type = "PLAINTEXT"
129+
},
130+
{
131+
name = "COMPANY_NAME"
132+
value = "Amazon"
133+
type = "PLAINTEXT"
134+
},
135+
{
136+
name = "TIME_ZONE"
137+
value = "Pacific/Auckland"
138+
type = "PLAINTEXT"
139+
}
140+
]
137141
}
138142
```
139143

@@ -212,6 +216,7 @@ Available targets:
212216
| <a name="input_badge_enabled"></a> [badge\_enabled](#input\_badge\_enabled) | Generates a publicly-accessible URL for the projects build badge. Available as badge\_url attribute when enabled | `bool` | `false` | no |
213217
| <a name="input_build_compute_type"></a> [build\_compute\_type](#input\_build\_compute\_type) | Instance type of the build instance | `string` | `"BUILD_GENERAL1_SMALL"` | no |
214218
| <a name="input_build_image"></a> [build\_image](#input\_build\_image) | Docker image for build environment, e.g. 'aws/codebuild/standard:2.0' 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 | `string` | `"aws/codebuild/standard:2.0"` | no |
219+
| <a name="input_build_image_pull_credentials_type"></a> [build\_image\_pull\_credentials\_type](#input\_build\_image\_pull\_credentials\_type) | Type of credentials AWS CodeBuild uses to pull images in your build.Valid values: CODEBUILD, SERVICE\_ROLE. When you use a cross-account or private registry image, you must use SERVICE\_ROLE credentials. | `string` | `"CODEBUILD"` | no |
215220
| <a name="input_build_timeout"></a> [build\_timeout](#input\_build\_timeout) | 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 | `number` | `60` | no |
216221
| <a name="input_build_type"></a> [build\_type](#input\_build\_type) | The type of build environment, e.g. 'LINUX\_CONTAINER' or 'WINDOWS\_CONTAINER' | `string` | `"LINUX_CONTAINER"` | no |
217222
| <a name="input_buildspec"></a> [buildspec](#input\_buildspec) | Optional buildspec declaration to use for building the project | `string` | `""` | no |
@@ -225,10 +230,12 @@ Available targets:
225230
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
226231
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
227232
| <a name="input_encryption_enabled"></a> [encryption\_enabled](#input\_encryption\_enabled) | When set to 'true' the resource will have AES256 encryption enabled by default | `bool` | `false` | no |
233+
| <a name="input_encryption_key"></a> [encryption\_key](#input\_encryption\_key) | AWS Key Management Service (AWS KMS) customer master key (CMK) to be used for encrypting the build project's build output artifacts. | `string` | `null` | no |
228234
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
229-
| <a name="input_environment_variables"></a> [environment\_variables](#input\_environment\_variables) | A list of maps, that contain the keys 'name', 'value', and 'type' to be used as additional environment variables for the build. Valid types are 'PLAINTEXT', 'PARAMETER\_STORE', or 'SECRETS\_MANAGER' | <pre>list(object(<br> {<br> name = string<br> value = string<br> type = string<br> }))</pre> | <pre>[<br> {<br> "name": "NO_ADDITIONAL_BUILD_VARS",<br> "type": "PLAINTEXT",<br> "value": "TRUE"<br> }<br>]</pre> | no |
235+
| <a name="input_environment_variables"></a> [environment\_variables](#input\_environment\_variables) | A list of maps, that contain the keys 'name', 'value', and 'type' to be used as additional environment variables for the build. Valid types are 'PLAINTEXT', 'PARAMETER\_STORE', or 'SECRETS\_MANAGER' | <pre>list(object(<br> {<br> name = string<br> value = string<br> type = string<br> }<br> ))</pre> | <pre>[<br> {<br> "name": "NO_ADDITIONAL_BUILD_VARS",<br> "type": "PLAINTEXT",<br> "value": "TRUE"<br> }<br>]</pre> | no |
230236
| <a name="input_extra_permissions"></a> [extra\_permissions](#input\_extra\_permissions) | List of action strings which will be added to IAM service account permissions. | `list(any)` | `[]` | no |
231237
| <a name="input_fetch_git_submodules"></a> [fetch\_git\_submodules](#input\_fetch\_git\_submodules) | If set to true, fetches Git submodules for the AWS CodeBuild build project. | `bool` | `false` | no |
238+
| <a name="input_file_system_locations"></a> [file\_system\_locations](#input\_file\_system\_locations) | A set of file system locations to to mount inside the build. File system locations are documented below. | `any` | `{}` | no |
232239
| <a name="input_git_clone_depth"></a> [git\_clone\_depth](#input\_git\_clone\_depth) | Truncate git history to this many commits. | `number` | `null` | no |
233240
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | (Optional) GitHub auth token environment variable (`GITHUB_TOKEN`) | `string` | `""` | no |
234241
| <a name="input_github_token_type"></a> [github\_token\_type](#input\_github\_token\_type) | Storage type of GITHUB\_TOKEN environment variable (`PARAMETER_STORE`, `PLAINTEXT`, `SECRETS_MANAGER`) | `string` | `"PARAMETER_STORE"` | no |
@@ -247,6 +254,7 @@ Available targets:
247254
| <a name="input_privileged_mode"></a> [privileged\_mode](#input\_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 | `bool` | `false` | no |
248255
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
249256
| <a name="input_report_build_status"></a> [report\_build\_status](#input\_report\_build\_status) | 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 source\_type is BITBUCKET or GITHUB | `bool` | `false` | no |
257+
| <a name="input_s3_cache_bucket_name"></a> [s3\_cache\_bucket\_name](#input\_s3\_cache\_bucket\_name) | Use an existing s3 bucket name for cache. Relevant if `cache_type` is set to `S3`. | `string` | `null` | no |
250258
| <a name="input_secondary_artifact_encryption_enabled"></a> [secondary\_artifact\_encryption\_enabled](#input\_secondary\_artifact\_encryption\_enabled) | Set to true to enable encryption on the secondary artifact bucket | `bool` | `false` | no |
251259
| <a name="input_secondary_artifact_identifier"></a> [secondary\_artifact\_identifier](#input\_secondary\_artifact\_identifier) | Secondary artifact identifier. Must match the identifier in the build spec | `string` | `null` | no |
252260
| <a name="input_secondary_artifact_location"></a> [secondary\_artifact\_location](#input\_secondary\_artifact\_location) | Location of secondary artifact. Must be an S3 reference | `string` | `null` | no |

README.yaml

+38-33
Original file line numberDiff line numberDiff line change
@@ -30,45 +30,50 @@ usage: |-
3030
3131
```hcl
3232
module "build" {
33-
source = "cloudposse/codebuild/aws"
34-
# Cloud Posse recommends pinning every module to a specific version
35-
# version = "x.x.x"
36-
namespace = "eg"
37-
stage = "staging"
38-
name = "app"
33+
source = "cloudposse/codebuild/aws"
34+
# Cloud Posse recommends pinning every module to a specific version
35+
# version = "x.x.x"
36+
namespace = "eg"
37+
stage = "staging"
38+
name = "app"
3939
40-
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
41-
build_image = "aws/codebuild/standard:2.0"
42-
build_compute_type = "BUILD_GENERAL1_SMALL"
43-
build_timeout = 60
40+
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
41+
build_image = "aws/codebuild/standard:2.0"
42+
build_compute_type = "BUILD_GENERAL1_SMALL"
43+
build_timeout = 60
4444
45-
# These attributes are optional, used as ENV variables when building Docker images and pushing them to ECR
46-
# For more info:
47-
# http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
48-
# https://www.terraform.io/docs/providers/aws/r/codebuild_project.html
45+
# These attributes are optional, used as ENV variables when building Docker images and pushing them to ECR
46+
# For more info:
47+
# http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
48+
# https://www.terraform.io/docs/providers/aws/r/codebuild_project.html
4949
50-
privileged_mode = true
51-
aws_region = "us-east-1"
52-
aws_account_id = "xxxxxxxxxx"
53-
image_repo_name = "ecr-repo-name"
54-
image_tag = "latest"
50+
privileged_mode = true
51+
aws_region = "us-east-1"
52+
aws_account_id = "xxxxxxxxxx"
53+
image_repo_name = "ecr-repo-name"
54+
image_tag = "latest"
5555
56-
# Optional extra environment variables
57-
environment_variables = [{
58-
name = "JENKINS_URL"
59-
value = "https://jenkins.example.com"
60-
},
61-
{
62-
name = "COMPANY_NAME"
63-
value = "Amazon"
64-
},
65-
{
66-
name = "TIME_ZONE"
67-
value = "Pacific/Auckland"
68-
69-
}]
56+
# Optional extra environment variables
57+
environment_variables = [
58+
{
59+
name = "JENKINS_URL"
60+
value = "https://jenkins.example.com"
61+
type = "PLAINTEXT"
62+
},
63+
{
64+
name = "COMPANY_NAME"
65+
value = "Amazon"
66+
type = "PLAINTEXT"
67+
},
68+
{
69+
name = "TIME_ZONE"
70+
value = "Pacific/Auckland"
71+
type = "PLAINTEXT"
72+
}
73+
]
7074
}
7175
```
76+
7277
include:
7378
- docs/targets.md
7479
- docs/terraform.md

0 commit comments

Comments
 (0)