As a heads up to anyone who uses the .ebextensions/*.config
way: nowadays you can add, edit and remove environment variables in the Elastic Beanstalk web interface.
The variables are under Configuration → Software Configuration:
Creating the vars in .ebextensions
like in Onema's answer still works.
It can even be preferable, e.g. if you will deploy to another environment later and are afraid of forgetting to manually set them, or if you are ok with committing the values to source control. I use a mix of both.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…