EB Deploy to multiple environments
You can make the eb cli refer to different environments from different branches by adding config like the following to your .elasticbeanstalk/config.yml
file:
branch-defaults:
main:
environment: staging
production:
environment: production
In this example When you run eb deploy
from the "main" branch, it will deploy to your environment named "staging", whereas when you run it from the "production" branch, it will deploy to your environment named "production".
This approach requires each environment have a dedicated branch. To push one branch to multiple environments, you can use @adnan's answer and specify a branch when you use the eb deploy
command:
eb deploy <environment_name>
To answer my own question. The AWS EB CLI 3+ has a nice interface to deploy to multiple environments. If you add another environment to your application you can simply deploy by using
eb deploy <environment-name>