Skip to content

Commit

Permalink
add container_definitions_secrets output
Browse files Browse the repository at this point in the history
  • Loading branch information
zahornyak committed Jul 11, 2023
1 parent f74f657 commit 6c9916a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,6 @@ module "parameters" {
}
}
locals {
ssm_vars = [
for k, v in module.parameters.parameters_arns : {
name = k
valueFrom = v
}
]
}
module "service_container_definition" {
source = "registry.terraform.io/cloudposse/ecs-container-definition/aws"
Expand All @@ -147,7 +138,7 @@ module "service_container_definition" {
}
]
secrets = local.ssm_vars
secrets = module.parameters.container_definitions_secrets
}
```
Expand Down Expand Up @@ -196,6 +187,7 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_container_definitions_secrets"></a> [container\_definitions\_secrets](#output\_container\_definitions\_secrets) | useful output for container definition secrets variable |
| <a name="output_parameters_arns"></a> [parameters\_arns](#output\_parameters\_arns) | parameters arns map |
| <a name="output_parameters_ids"></a> [parameters\_ids](#output\_parameters\_ids) | parameters ids map |
| <a name="output_parameters_name_arns"></a> [parameters\_name\_arns](#output\_parameters\_name\_arns) | merged parameters arns map with names of parameter |
Expand Down
13 changes: 13 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ output "parameters_name_arns" {
for key, param in merge(aws_ssm_parameter.this, aws_ssm_parameter.parsed, aws_ssm_parameter.unlocked) : param.name => param.arn
}
}

locals {
parameter_arns = { for k, v in merge(aws_ssm_parameter.this, aws_ssm_parameter.parsed, aws_ssm_parameter.unlocked) : k => v["arn"] }
}
output "container_definitions_secrets" {
value = [
for k, v in local.parameter_arns : {
name = k
valueFrom = v
}
]
description = "useful output for container definition secrets variable"
}

0 comments on commit 6c9916a

Please sign in to comment.