Skip to content

Commit 7eb84ec

Browse files
committed
Merge branch 'main' into feature/CCM-7001_branch-auto-disconnection
2 parents 0eedff2 + 5ccc23a commit 7eb84ec

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

infrastructure/terraform/components/app/ssm_parameter_amplify_password.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
resource "aws_ssm_parameter" "amplify_password" {
22
count = var.enable_amplify_basic_auth ? 1 : 0
33

4-
name = "/${local.csi}/amplify_password"
4+
name = "/${local.csi}/amplify_password"
5+
description = "The Basic Auth password used for the amplify app. This parameter is sourced from Github Environment variables"
6+
57
type = "String"
6-
value = random_password.password[0].result
8+
value = var.AMPLIFY_BASIC_AUTH_SECRET != "unset" ? var.AMPLIFY_BASIC_AUTH_SECRET : random_password.password[0].result
79
}
810

911
resource "random_password" "password" {
10-
count = var.enable_amplify_basic_auth ? 1 : 0
12+
count = var.enable_amplify_basic_auth && var.AMPLIFY_BASIC_AUTH_SECRET == "unset" ? 1 : 0
1113

1214
length = 16
1315
special = true

infrastructure/terraform/components/app/variables.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,15 @@ variable "enable_cognito_built_in_idp" {
9090
variable "enable_amplify_basic_auth" {
9191
type = bool
9292
description = "Enable a basic set of credentials in the form of a dynamicly generated username and password for the amplify app branches. Not intended for production use"
93-
default = false
93+
default = true
94+
}
95+
96+
# Github Environments only handles uppercase envvars
97+
variable "AMPLIFY_BASIC_AUTH_SECRET" {
98+
# Github only does uppercase env vars
99+
type = string
100+
description = "Secret key/password to use for Amplify Basic Auth - This is entended to be read from CI variables and not commited to any codebase"
101+
default = "unset"
94102
}
95103

96104
variable "branch_name" {

0 commit comments

Comments
 (0)