When I enter a value that has a dollar sign $
the environment only reads the first part of it, and that's because the env file generated puts double quotes in the values instead of single quotes. Any way around that? The value can't be changed because it's an access token from a service I don't control.
Example:
The env file generated is like:
export MY_VAR="my$value"
Running that results in:
MY_VAR=my
Environment properties are written to the /opt/python/current/env file, which is sourced into the virtualenv stack where the application runs. For more information, see Using the Elastic Beanstalk Python platform.
In AWS Elastic Beanstalk, you can create a load-balanced, scalable environment or a single-instance environment. The type of environment that you require depends on the application that you deploy.
Either escape the dollar signs with three backslashes (works using either the web console or the command line):
eb setenv -e my-environment MY_VARIABLE=\\\$foobar
Or with a strong quotes (''
) you would only have to use one backslash to escape:
eb setenv -e my-environment MY_VARIABLE='\$foobar'
It is evaluating $value
as a variable and converting it to an empty string since that variable doesn't exist in the environment. Try escaping the $
character like this:
export MY_VAR="my\$value"
Alternatively, use single quotes which should prevent variable expansion:
export MY_VAR='my$value'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With