aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.52k stars 1.01k forks source link

Setting environment variables securly #2106

Open yuvadm opened 1 month ago

yuvadm commented 1 month ago

Documentation states that all environment variables, global or per-stage, should be set in .chalice/config.json.

However, assuming config.json is committed to source control, this is a bad practice that commit secrets to a shared project.

Setting environment variables directly through the AWS Lambda web UI is a non-solution since they will be deleted / overridden on the next chalice deploy.

What's the best way to store env vars in a secure way that also allows committing config.json to source control?

AmirFone commented 1 month ago

Maybe use AWS Systems Manager and then fetch at runtime as a best practice, and a secure solution

yuvadm commented 1 month ago

@AmirFone interesting proposal, but right now I'm using a very lean deployment of Lambda/Chalice and would prefer a solution that does not involve any additional AWS products that will bloat my deployment.