Skip to content

Commit f2c178b

Browse files
support type key for CodeBuild environment variables (#88)
Co-authored-by: cloudpossebot <[email protected]>
1 parent 3c23c4e commit f2c178b

8 files changed

+193
-171
lines changed

README.md

+89-84
Large diffs are not rendered by default.

docs/terraform.md

+88-82
Large diffs are not rendered by default.

examples/complete/fixtures.us-east-2.tfvars

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ environment_variables = [
1212
{
1313
name = "APP_URL"
1414
value = "https://app.example.com"
15+
type = "PLAINTEXT"
1516
},
1617
{
1718
name = "COMPANY_NAME"
1819
value = "Cloud Posse"
20+
type = "PLAINTEXT"
1921
},
2022
{
2123
name = "TIME_ZONE"
2224
value = "America/Los_Angeles"
23-
25+
type = "PLAINTEXT"
2426
}
2527
]
2628

examples/complete/variables.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ variable "environment_variables" {
88
{
99
name = string
1010
value = string
11+
type = string
1112
}))
1213

1314
default = [
1415
{
1516
name = "NO_ADDITIONAL_BUILD_VARS"
1617
value = "TRUE"
18+
type = "PLAINTEXT"
1719
}]
1820

19-
description = "A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build"
21+
description = "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'"
2022
}
2123

2224
variable "cache_expiration_days" {

examples/vpc/fixtures.us-east-2.tfvars

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ environment_variables = [
1616
{
1717
name = "APP_URL"
1818
value = "https://app.example.com"
19+
type = "PLAINTEXT"
1920
},
2021
{
2122
name = "COMPANY_NAME"
2223
value = "Cloud Posse"
24+
type = "PLAINTEXT"
2325
},
2426
{
2527
name = "TIME_ZONE"
2628
value = "America/Los_Angeles"
27-
29+
type = "PLAINTEXT"
2830
}
2931
]
3032

examples/vpc/variables.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ variable "environment_variables" {
1818
{
1919
name = string
2020
value = string
21+
type = string
2122
}))
2223

2324
default = [
2425
{
2526
name = "NO_ADDITIONAL_BUILD_VARS"
2627
value = "TRUE"
28+
type = "PLAINTEXT"
2729
}]
2830

29-
description = "A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build"
31+
description = "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'"
3032
}
3133

3234
variable "cache_expiration_days" {

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ resource "aws_codebuild_project" "default" {
390390
content {
391391
name = environment_variable.value.name
392392
value = environment_variable.value.value
393+
type = environment_variable.value.type
393394
}
394395
}
395396

variables.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ variable "environment_variables" {
33
{
44
name = string
55
value = string
6+
type = string
67
}))
78

89
default = [
910
{
1011
name = "NO_ADDITIONAL_BUILD_VARS"
1112
value = "TRUE"
13+
type = "PLAINTEXT"
1214
}]
1315

14-
description = "A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build"
16+
description = "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'"
1517
}
1618

1719
variable "cache_expiration_days" {

0 commit comments

Comments
 (0)