Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit e025af7

Browse files
Stretch96squidfunk
authored andcommitted
Added support for environment variables (#12)
* Although undocumented, `environment_variable` can take a list of environment variables - hashicorp/terraform-provider-aws#5563
1 parent c5062e6 commit e025af7

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ The following variables can be configured:
151151
- **Description**: S3 bucket to store status badge and artifacts
152152
- **Default**: `"${var.namespace}"` (equal to namespace)
153153

154+
#### `codebuild_environment_variables`
155+
- **Description**: CodeBuild Environment variables
156+
- **Deafult**: []
157+
- **Conflicts with**: `codebuild_project`
158+
154159
### Outputs
155160

156161
The following outputs are exported:

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ resource "aws_codebuild_project" "_" {
118118
}
119119

120120
environment {
121-
compute_type = "${var.codebuild_compute_type}"
122-
type = "LINUX_CONTAINER"
123-
image = "${var.codebuild_image}"
124-
privileged_mode = "${var.codebuild_privileged_mode}"
121+
compute_type = "${var.codebuild_compute_type}"
122+
type = "LINUX_CONTAINER"
123+
image = "${var.codebuild_image}"
124+
privileged_mode = "${var.codebuild_privileged_mode}"
125+
environment_variable = "${var.codebuild_environment_variables}"
125126
}
126127

127128
artifacts {

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ variable "codebuild_bucket" {
9292
default = ""
9393
}
9494

95+
# var.codebuild_environment_variables
96+
variable "codebuild_environment_variables" {
97+
description = "Environment variables to be used for build"
98+
default = []
99+
type = "list"
100+
}
101+
95102
# var.codebuild_badge_enabled
96103
variable "codebuild_badge_enabled" {
97104
description = "Generates a publicly-accessible URL for the projects build badge"

0 commit comments

Comments
 (0)