I have difficulty trying to set up over 100 environment variables in my production Elastic Beanstalk running Django. The AWS docs mention that
The combined size of all environment properties cannot exceed 4,096 bytes when stored as strings with the format key=value.
To my understanding there are 3 ways to set env vars in ELB.
Through
eb cli
e.geb setenv key=value
(Doesn't work because it'll error out because of maximum length after reaching the maximum no. of characters)Through the EB GUI Configuration > Software > Env variables (Doesn't work for the same reason above)
Through
option_settings:
- option_name: CUSTOM_ENV value: staging
I imagine 3) would fail for the same reason too.
I'm now experimenting with downloading my variables.env file from my S3 bucket and then replacing /opt/python/current/env with it
files:
# Private key
"/opt/python/current":
mode: "000400"
owner: root
group: root
authentication: "S3Auth"
source: ****/env
the idea being that ELB injects environment variables through that file. Unfortunately, the deployment errors out (permission error).
Is there a way to circumvent the 4096 bytes limitation on ELB environment variables?