This script is a utility to easily convert any JSON into a KEY=VALUE format (like env files).
Copy the contents of to_env.sh to /usr/local/bin and make it executable:
curl https://gist.githubusercontent.com/gryzinsky/4bab74c04c43ffb3ad794aadd831fd12/raw/b8fe744eb819bd380b59e402d3001c33885a9f3c/to_env.sh > /usr/local/bin/to_env && chmod 755 /usr/local/bin/to_env
Store your environment as a KV pair in AWS Secrets Manager.
Now, using the AWS CLI, retrieve and convert the secret to env format:
aws secretsmanager get-secret-value --secret-id "my-secret" | to_env
.
You can modify the script to support any JSON input, just remove jq -r .SecretString |
from line 10.