Skip to content

Commit 6962ee6

Browse files
authored
Merge pull request #3 from hazelops/feature/improve-global-params
Update secrets in container_definition block
2 parents 938b208 + b859226 commit 6962ee6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

main.tf

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
data "aws_region" "current" {}
2+
data "aws_caller_identity" "current" {}
23

34
locals {
45
global_secrets = concat(var.secret_names, [
@@ -34,7 +35,12 @@ locals {
3435

3536
environment = [for k, v in local.environment : { name = k, value = v }]
3637

37-
secrets = module.ssm.secrets
38+
secrets = [for param_name in local.global_secrets :
39+
{
40+
name = param_name
41+
valueFrom = "arn:aws:ssm:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:parameter/${var.env}/global/${param_name}"
42+
}
43+
]
3844

3945
mountPoints = var.ecs_launch_type == "FARGATE" ? [] : concat([
4046
{
@@ -113,11 +119,3 @@ locals {
113119
)
114120

115121
}
116-
117-
module "ssm" {
118-
source = "hazelops/ssm-secrets/aws"
119-
version = "~> 1.0"
120-
env = var.env
121-
app_name = "global"
122-
names = var.enabled ? local.global_secrets : []
123-
}

0 commit comments

Comments
 (0)