This lab goes through the steps of setting up a Blue/Green deployment in Elastic Beanstalk. It incudes launching a sample PHP application and realising an update to it in Blue/Green deployment, which will create a new parallel environment.
- Create application in Elastic Beanstalk
- Deploy two versions of applications
- Swapping between environments
- AWS account
- Create an application in Elastic Beanstalk. Choose PHP as platform and use a sample application. This will take couple of minutes.
- When done, go to the Applications and choose yours. Then in Actions drop-down menu choose Create a new environment, then Web server tier. Give it a name indicating that it’s a Blue deployment and choose PHP as platform. Click on Create environment. This will create a new environment after a while.
- Once the new environment is provisioned you can open the URL with running PHP application.
There will be two environments of your application:
- Now create one more environment. This time it’ll be a Green deployment and with Node.js as platform.
- Now that two environments are created it’s time to swap the URLs pointing to the one that you wish to test. Choose the Green environment and in Actions menu select Swap Environment URLs. Choose the blue environment from the dropdown menu and select it as a one to swap.
- Note that even though that we’re working with the green environment it has the blue’s URL now:
- Next step will be setting up Route53 CNAME addresses pointing to those environments and maybe realising apps for testing.
- Delete application afterwards.