DEV Community

Discussion on: Dynamic injection of secrets into ECS Task Definition with SSM Parameter Store

Collapse
 
raphaskin profile image
Raphael Oliveira

Nice work!
I would like to know if there is any way to add new parameters to the json file?
I tried like this:

jq --argjson secretsInfo "$ (<file.json)" '.containerDefinitions [1] .secrets + = [$ secretsInfo]' file.tmp

However, the file has an additional error occurring when updating the task in aws.

"secrets": [
[ <--- This
{
"name": "TESTKEY2",
"valueFrom": "arn:aws:ssm:us-west-1:xxxxxx:parameter/TESTKEY"
},
{
"name": "TESTKEY2",
"valueFrom": "arn:aws:ssm:us-west-1:xxxxxx:parameter/TESTKEY2"
}
] <--- This
]