Skip to content

Commit 734aad6

Browse files
add artifact_location variable (#72)
* added variable for artifacts location * specify location of artifact * Updated README.md Co-authored-by: actions-bot <[email protected]>
1 parent 37d8854 commit 734aad6

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are
6464
## Usage
6565

6666

67-
**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.
68-
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).
67+
**IMPORTANT:** We do not pin modules to versions in our examples because of the
68+
difficulty of keeping the versions in the documentation in sync with the latest released versions.
69+
We highly recommend that in your code you pin the version to the exact version you are
70+
using so that your infrastructure remains stable, and update versions in a
71+
systematic way so that they do not catch you by surprise.
72+
73+
Also, because of a bug in the Terraform registry ([hashicorp/terraform#21417](https://github.com/hashicorp/terraform/issues/21417)),
74+
the registry shows many of our inputs as required when in fact they are optional.
75+
The table below correctly indicates which inputs are required.
6976

7077

7178
Include this module in your existing terraform code:
@@ -151,6 +158,7 @@ Available targets:
151158
| Name | Description | Type | Default | Required |
152159
|------|-------------|------|---------|:--------:|
153160
| additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no |
161+
| artifact\_location | Location of artifact. Applies only for artifact of type S3 | `string` | `""` | no |
154162
| artifact\_type | The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO\_ARTIFACTS or S3 | `string` | `"CODEPIPELINE"` | no |
155163
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
156164
| aws\_account\_id | (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 | `string` | `""` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| Name | Description | Type | Default | Required |
2323
|------|-------------|------|---------|:--------:|
2424
| additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no |
25+
| artifact\_location | Location of artifact. Applies only for artifact of type S3 | `string` | `""` | no |
2526
| artifact\_type | The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO\_ARTIFACTS or S3 | `string` | `"CODEPIPELINE"` | no |
2627
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
2728
| aws\_account\_id | (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 | `string` | `""` | no |

main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ resource "aws_codebuild_project" "default" {
189189
}
190190

191191
artifacts {
192-
type = var.artifact_type
192+
type = var.artifact_type
193+
location = var.artifact_location
193194
}
194195

195196
cache {

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ variable "artifact_type" {
126126
description = "The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO_ARTIFACTS or S3"
127127
}
128128

129+
variable "artifact_location" {
130+
type = string
131+
default = ""
132+
description = "Location of artifact. Applies only for artifact of type S3"
133+
}
134+
129135
variable "report_build_status" {
130136
type = bool
131137
default = false

0 commit comments

Comments
 (0)