containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[ECS] [parameter get all keys by path]: secrets from parameter store just provide a path

Open nodesocket opened this issue 6 years ago • 7 comments

In ECS and the task definition I use secrets stored in parameter store like:

"secrets":[
      {
         "valueFrom":"arn:aws:ssm:us-west-1:XXXXXXXXXXX:parameter/WEB_APP/DB_PASSWORD",
         "name":"DB_PASSWORD"
      },
      {
        "valueFrom": "arn:aws:ssm:us-west-1:XXXXXXXXXXX:parameter/WEB_APP/DB_USERNAME",
        "name": "DB_USERNAME"
      },
      {
        "valueFrom": "arn:aws:ssm:us-west-1:XXXXXXXXXXX:parameter/WEB_APP/DB_HOST",
        "name": "DB_HOST"
      },
     ...
]

We have lots of secrets, so defining all them in the task definition JSON becomes tedious and very error prone. Instead, I should just be able to define a path and ECS should pull down all keys in that path from parameter store and use them.

Example of how that could look:

"secrets":[
      {
         "valueFrom":"arn:aws:ssm:us-west-1:XXXXXXXXXXX:parameter/WEB_APP/*"
      }
]

nodesocket avatar Oct 16 '19 19:10 nodesocket

This would be very helpful for making more generic terraform modules.

vegardx avatar Nov 22 '19 12:11 vegardx

Yes! Please! We are avoiding using the secrets[].valueFrom thing basically for lack of this feature. Engineers have pushed back that the list of parameters here effectively represents a second source of truth. Instead we rely on an entrypoint script that does the get-parameters-by-path thing.

However, the entrypoint script brings with it a limitation that many of us would like to ditch.

dayer4b avatar Jun 05 '20 21:06 dayer4b

Any update on this? Allowing wildcard pulling of a path from parameter store would be a huge win in our Terraform.

nodesocket avatar Jul 27 '20 22:07 nodesocket

I just noticed that this seems very similar to issue #246. In that issue, the reporter mentions a tool called ssm-parent. I haven't tried it, but that may help some people.

dayer4b avatar Dec 22 '20 14:12 dayer4b

We are facing the same issue. would love to see this for our fargate containers and greatly reduces our ops complexity

anagarjunr avatar Dec 25 '20 12:12 anagarjunr

There is a very similar tool to ssm-parent called chamber which we are using in the meantime.

phillipuniverse avatar Nov 15 '21 14:11 phillipuniverse

Bump from 2024!

tetienne-zenchef avatar Sep 05 '24 08:09 tetienne-zenchef