Skip to content

Instantly share code, notes, and snippets.

@carrfane
Created February 8, 2021 20:20
Show Gist options
  • Save carrfane/58c2b6bba7b059d5900ec1309c8469b2 to your computer and use it in GitHub Desktop.
Save carrfane/58c2b6bba7b059d5900ec1309c8469b2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Getting the environment variables
values=$(/opt/elasticbeanstalk/bin/get-config environment)
# Parsing the json and exporting them as environment variables
for env in $(echo $values | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" ); do
export $env
done
# Command to run this file
# . load_env.sh (or) source load_env.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment