aws-ssm icon indicating copy to clipboard operation
aws-ssm copied to clipboard

Option to sync to ConfigMaps as well as Secrets

Open tdmalone opened this issue 5 years ago • 4 comments

Hi there,

Thank you for putting this tool together - it's incredibly helpful and works great!

I'm syncing multiple parameters from SSM, some are 'secret' and some are just plain configuration data. To keep things semantically correct, I'd ideally like to sync the plain config data to a ConfigMap instead of a secret.

I'm fairly new to Kubernetes but my understanding at the moment is that ConfigMaps and Secrets are almost the same (Secrets are just base64 encoded for now and may have encryption features added in future). I'm wondering therefore whether it might be possible for this tool to also sync ConfigMap resources, using pretty much the same annotations?

tdmalone avatar May 29 '19 00:05 tdmalone

I've actually been considering this, perhaps as part of a separate tool, maybe in conjunction with some code from dir2cm to load files from S3 into ConfigMaps.

You're right - they're roughly the same in the ways they're defined and used, with Secrets having . In theory, it could easily sync to ConfigMaps too; it just explicitly interacts with Secrets right now.

I'm currently refactoring this in Lambda (and starting a new job) so I might not get to this for a while, but feel free to send a PR.

cmattoon avatar May 29 '19 14:05 cmattoon

No worries - I haven’t written Go before, but this is probably a good place to start; I’ll try to get around to doing a PR (if no-one else does in the meantime).

Congrats on the new job!

tdmalone avatar May 29 '19 21:05 tdmalone

Ok - I got this working on my fork:

https://github.com/cmattoon/aws-ssm/compare/master...tdmalone:master

Fair warning - I'm not a Go programmer. I almost literally copied and pasted the Secret configuration and did a find/replace.

It's working on my test cluster though!

I suspect for a PR you will want a much better job done with much less repetition; I wouldn't know how to go about that in Go but hopefully this helps anyone else who might want to use ConfigMaps in the meantime.

(Docker build also available at tdmalone/aws-ssm:latest, tracking my fork's master)

tdmalone avatar Jun 14 '19 05:06 tdmalone

If this could be included, this would be amazing.

wallentx avatar Oct 23 '20 18:10 wallentx