Skip to content

Commit 41328b3

Browse files
app-rails: Update template-infra:app to version 0.15.3.post2.dev0+8d7ab07
1 parent c7db6e2 commit 41328b3

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

.template-infra/app-app-rails.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.15.3-1-gc805160
2+
_commit: v0.15.3-2-g8d7ab07
33
_src_path: https://github.com/navapbc/template-infra
44
app_has_dev_env_setup: true
55
app_local_port: 3100

infra/app-rails/service/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ module "service" {
101101
)
102102

103103
secrets = concat(
104-
[for secret_name in keys(local.service_config.secrets) : {
104+
[for secret_name, secret_arn in module.secrets.secret_arns : {
105105
name = secret_name
106-
valueFrom = module.secrets[secret_name].secret_arn
106+
valueFrom = secret_arn
107107
}],
108108
local.feature_flags_secrets,
109109
module.app_config.enable_identity_provider ? [{

infra/app-rails/service/secrets.tf

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
module "secrets" {
2-
for_each = local.service_config.secrets
2+
source = "../../modules/secrets"
33

4-
source = "../../modules/secret"
4+
service_name = local.service_name
5+
secrets = {
6+
for name, config in local.service_config.secrets :
7+
name => {
8+
manage_method = config.manage_method
59

6-
# When generating secrets and storing them in parameter store, append the
7-
# terraform workspace to the secret store path if the environment is temporary
8-
# to avoid conflicts with existing environments.
9-
# Don't do this for secrets that are managed manually since the temporary
10-
# environments will need to share those secrets.
11-
secret_store_name = (each.value.manage_method == "generated" && local.is_temporary ?
12-
"${each.value.secret_store_name}/${terraform.workspace}" :
13-
each.value.secret_store_name
14-
)
15-
manage_method = each.value.manage_method
10+
# When generating secrets and storing them in parameter store, append the
11+
# terraform workspace to the secret store path if the environment is temporary
12+
# to avoid conflicts with existing environments.
13+
# Don't do this for secrets that are managed manually since the temporary
14+
# environments will need to share those secrets.
15+
secret_store_name = (config.manage_method == "generated" && local.is_temporary ?
16+
"${config.secret_store_name}/${terraform.workspace}" :
17+
config.secret_store_name
18+
)
19+
}
20+
}
1621
}

0 commit comments

Comments
 (0)