Skip to content

Commit 7da8df5

Browse files
bsAdvanonaknysh
authored andcommitted
Add bucket ARN output (#41)
* Add bucket ARN output In some cases (like interpolating the module's created bucket in another IAM policy) the ARN of the bucket is needed for interpolation. Adding output so that I don't have to use a data source to resolve the ARN from the bucket name. * Update docs/readme
1 parent 9e719e7 commit 7da8df5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are
4242

4343
## Usage
4444

45+
46+
**IMPORTANT:** The `master` branch is used in `source` just as an example. In your code, do not pin to `master` because there may be breaking changes between releases.
47+
Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/cloudposse/terraform-aws-codebuild/releases).
48+
49+
4550
Include this module in your existing terraform code:
4651

4752
```hcl
@@ -148,6 +153,7 @@ Available targets:
148153
| Name | Description |
149154
|------|-------------|
150155
| badge_url | The URL of the build badge when badge_enabled is enabled |
156+
| cache_bucket_arn | Cache S3 bucket ARN |
151157
| cache_bucket_name | Cache S3 bucket name |
152158
| project_id | Project ID |
153159
| project_name | Project name |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
| Name | Description |
3535
|------|-------------|
3636
| badge_url | The URL of the build badge when badge_enabled is enabled |
37+
| cache_bucket_arn | Cache S3 bucket ARN |
3738
| cache_bucket_name | Cache S3 bucket name |
3839
| project_id | Project ID |
3940
| project_name | Project name |

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ output "cache_bucket_name" {
2323
value = "${var.enabled == "true" && var.cache_enabled == "true" ? join("", aws_s3_bucket.cache_bucket.*.bucket) : "UNSET" }"
2424
}
2525

26+
output "cache_bucket_arn" {
27+
description = "Cache S3 bucket ARN"
28+
value = "${var.enabled == "true" && var.cache_enabled == "true" ? join("", aws_s3_bucket.cache_bucket.*.arn) : "UNSET" }"
29+
}
30+
2631
output "badge_url" {
2732
description = "The URL of the build badge when badge_enabled is enabled"
2833
value = "${join("", aws_codebuild_project.default.*.badge_url)}"

0 commit comments

Comments
 (0)