I am deploying a Python Flask application with Elastic Beanstalk. I have a config file /.ebextensions/01.config
where among other things I set some environment
Some of the other answers are mentioning that there might be a better way with Parameter Store / Secrets Manager.
I described how I did this with AWS Systems Manager Parameter Store (which also gives you an interface to Secrets Manager) in this answer: https://stackoverflow.com/a/59910941/159178. Basically, you give your Beanstalk ECS IAM role access to the relevant parameter and then load it from your application code at startup.