cmattoon / aws-ssm

Populates Kubernetes Secrets from AWS Parameter Store
https://hub.docker.com/r/cmattoon/aws-ssm/
Apache License 2.0
166 stars 32 forks source link

Multiple parameters in one secret #9

Closed msacchiPPRO closed 5 years ago

msacchiPPRO commented 5 years ago

If I understand this correctly, currently it's only possible to map 1-1 parameters and secrets key (one SSM parameter per secret). It would be nice if multiple parameters could be added as multiple key-value pairs in the same secret

msacchiPPRO commented 5 years ago

Oh, I just got (by reading the code) the key=value with StringList parameters. It kind of solves my problem (it's really ugly but it's SSM's fault I guess :)

However, if the StringList is not valid (one entry is not key=value) the program crashes. I am not a go programmer (or a programmer at all -_-' ) so I cannot propose a fix. But it would be nice for the software to manage that exception and keep updating other parameters.

tbastos commented 5 years ago

+1

Probably a better solution for multiple parameters in one secret (instead of StringList) would be to specify a SSM "folder" with many parameters, and aws-ssm could get a list of parameters to include in the secret using SSM.GetParametersByPath ?

cmattoon commented 5 years ago

Thanks for the report! I've added some more test cases and made the logic a little smarter about parsing the StringList. It's being published as cmattoon/aws-ssm:PR-10.

I like the GetParametersByPath idea, but I might not get around to it for a little while. My use case is pretty basic and I don't use SSM in conjunction with some of the other config mgmt services/features they offer, so I've been hesitant to make it too fancy. That method does seem like the correct path, though we might have to give some thought as to how merging those params should happen.

cmattoon commented 5 years ago

(That fix is available in the dev or latest image now)

cmattoon commented 5 years ago

Closed with v0.1.5