Skip to content

Commit 7fdb2e6

Browse files
authored
Exposes codebuilds 'cache_bucket_suffix_enabled' variable. (#69)
1 parent ae5c1ed commit 7fdb2e6

File tree

4 files changed

+83
-20
lines changed

4 files changed

+83
-20
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,34 @@ Available targets:
222222
| aws | >= 2.0 |
223223
| random | >= 2.1 |
224224
225+
## Modules
226+
227+
| Name | Source | Version |
228+
|------|--------|---------|
229+
| codebuild | cloudposse/codebuild/aws | 0.31.1 |
230+
| codebuild_label | cloudposse/label/null | 0.24.1 |
231+
| codepipeline_assume_role_label | cloudposse/label/null | 0.24.1 |
232+
| codepipeline_label | cloudposse/label/null | 0.24.1 |
233+
| codepipeline_s3_policy_label | cloudposse/label/null | 0.24.1 |
234+
| codestar_label | cloudposse/label/null | 0.24.1 |
235+
| github_webhooks | cloudposse/repository-webhooks/github | 0.12.0 |
236+
| this | cloudposse/label/null | 0.24.1 |
237+
238+
## Resources
239+
240+
| Name |
241+
|------|
242+
| [aws_caller_identity](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/caller_identity) |
243+
| [aws_codepipeline](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/codepipeline) |
244+
| [aws_codepipeline_webhook](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/codepipeline_webhook) |
245+
| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_policy) |
246+
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/iam_policy_document) |
247+
| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_role) |
248+
| [aws_iam_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_role_policy_attachment) |
249+
| [aws_region](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/region) |
250+
| [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/s3_bucket) |
251+
| [random_string](https://registry.terraform.io/providers/hashicorp/random/2.1/docs/resources/string) |
252+
225253
## Inputs
226254
227255
| Name | Description | Type | Default | Required |
@@ -235,6 +263,7 @@ Available targets:
235263
| build\_image | Docker image for build environment, _e.g._ `aws/codebuild/docker:docker:17.09.0` | `string` | `"aws/codebuild/docker:17.09.0"` | no |
236264
| 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 |
237265
| buildspec | Declaration to use for building the project. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) | `string` | `""` | no |
266+
| cache\_bucket\_suffix\_enabled | 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. It only works when cache\_type is 'S3' | `bool` | `true` | no |
238267
| cache\_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO\_CACHE, LOCAL, and S3. Defaults to S3. If cache\_type is S3, it will create an S3 bucket for storing codebuild cache inside | `string` | `"S3"` | no |
239268
| codestar\_connection\_arn | CodeStar connection ARN required for Bitbucket integration with CodePipeline | `string` | `""` | no |
240269
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
@@ -287,7 +316,6 @@ Available targets:
287316
| codepipeline\_id | CodePipeline ID |
288317
| webhook\_id | The CodePipeline webhook's ID |
289318
| webhook\_url | The CodePipeline webhook's URL. POST events to this endpoint to trigger the target |
290-
291319
<!-- markdownlint-restore -->
292320

293321

docs/terraform.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@
1717
| aws | >= 2.0 |
1818
| random | >= 2.1 |
1919

20+
## Modules
21+
22+
| Name | Source | Version |
23+
|------|--------|---------|
24+
| codebuild | cloudposse/codebuild/aws | 0.31.1 |
25+
| codebuild_label | cloudposse/label/null | 0.24.1 |
26+
| codepipeline_assume_role_label | cloudposse/label/null | 0.24.1 |
27+
| codepipeline_label | cloudposse/label/null | 0.24.1 |
28+
| codepipeline_s3_policy_label | cloudposse/label/null | 0.24.1 |
29+
| codestar_label | cloudposse/label/null | 0.24.1 |
30+
| github_webhooks | cloudposse/repository-webhooks/github | 0.12.0 |
31+
| this | cloudposse/label/null | 0.24.1 |
32+
33+
## Resources
34+
35+
| Name |
36+
|------|
37+
| [aws_caller_identity](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/caller_identity) |
38+
| [aws_codepipeline](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/codepipeline) |
39+
| [aws_codepipeline_webhook](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/codepipeline_webhook) |
40+
| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_policy) |
41+
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/iam_policy_document) |
42+
| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_role) |
43+
| [aws_iam_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/iam_role_policy_attachment) |
44+
| [aws_region](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/data-sources/region) |
45+
| [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/2.0/docs/resources/s3_bucket) |
46+
| [random_string](https://registry.terraform.io/providers/hashicorp/random/2.1/docs/resources/string) |
47+
2048
## Inputs
2149

2250
| Name | Description | Type | Default | Required |
@@ -30,6 +58,7 @@
3058
| build\_image | Docker image for build environment, _e.g._ `aws/codebuild/docker:docker:17.09.0` | `string` | `"aws/codebuild/docker:17.09.0"` | no |
3159
| 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 |
3260
| buildspec | Declaration to use for building the project. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) | `string` | `""` | no |
61+
| cache\_bucket\_suffix\_enabled | 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. It only works when cache\_type is 'S3' | `bool` | `true` | no |
3362
| cache\_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO\_CACHE, LOCAL, and S3. Defaults to S3. If cache\_type is S3, it will create an S3 bucket for storing codebuild cache inside | `string` | `"S3"` | no |
3463
| codestar\_connection\_arn | CodeStar connection ARN required for Bitbucket integration with CodePipeline | `string` | `""` | no |
3564
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
@@ -82,5 +111,4 @@
82111
| codepipeline\_id | CodePipeline ID |
83112
| webhook\_id | The CodePipeline webhook's ID |
84113
| webhook\_url | The CodePipeline webhook's URL. POST events to this endpoint to trigger the target |
85-
86114
<!-- markdownlint-restore -->

main.tf

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,25 @@ data "aws_region" "default" {
207207
}
208208

209209
module "codebuild" {
210-
source = "cloudposse/codebuild/aws"
211-
version = "0.31.1"
212-
build_image = var.build_image
213-
build_compute_type = var.build_compute_type
214-
build_timeout = var.build_timeout
215-
buildspec = var.buildspec
216-
delimiter = module.this.delimiter
217-
attributes = ["build"]
218-
privileged_mode = var.privileged_mode
219-
aws_region = var.region != "" ? var.region : data.aws_region.default.name
220-
aws_account_id = var.aws_account_id != "" ? var.aws_account_id : data.aws_caller_identity.default.account_id
221-
image_repo_name = var.image_repo_name
222-
image_tag = var.image_tag
223-
github_token = var.github_oauth_token
224-
environment_variables = var.environment_variables
225-
badge_enabled = var.badge_enabled
226-
cache_type = var.cache_type
227-
local_cache_modes = var.local_cache_modes
210+
source = "cloudposse/codebuild/aws"
211+
version = "0.31.1"
212+
build_image = var.build_image
213+
build_compute_type = var.build_compute_type
214+
build_timeout = var.build_timeout
215+
buildspec = var.buildspec
216+
delimiter = module.this.delimiter
217+
attributes = ["build"]
218+
privileged_mode = var.privileged_mode
219+
aws_region = var.region != "" ? var.region : data.aws_region.default.name
220+
aws_account_id = var.aws_account_id != "" ? var.aws_account_id : data.aws_caller_identity.default.account_id
221+
image_repo_name = var.image_repo_name
222+
image_tag = var.image_tag
223+
github_token = var.github_oauth_token
224+
environment_variables = var.environment_variables
225+
badge_enabled = var.badge_enabled
226+
cache_type = var.cache_type
227+
cache_bucket_suffix_enabled = var.cache_bucket_suffix_enabled
228+
local_cache_modes = var.local_cache_modes
228229

229230
context = module.this.context
230231
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ variable "cache_type" {
166166
description = "The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO_CACHE, LOCAL, and S3. Defaults to S3. If cache_type is S3, it will create an S3 bucket for storing codebuild cache inside"
167167
}
168168

169+
variable "cache_bucket_suffix_enabled" {
170+
type = bool
171+
default = true
172+
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. It only works when cache_type is 'S3'"
173+
}
174+
169175
variable "local_cache_modes" {
170176
type = list(string)
171177
default = []

0 commit comments

Comments
 (0)