In this section we will provision the monolith web architecture consisting of AWS Application Load Balancer and two EC2 instances Webserver and Appserver running containers for frontend, application, Redis cache and MySQL database.
cd ~/environment
git clone https://github.com/aws-samples/moving-up-stack-workshop
cd moving-up-stack-workshop
cd ~/environment
cd moving-up-stack-workshop/resources/code/scenario0/templates/
aws cloudformation deploy --template-file scenario0_infrastructure.yml --region ${AWS_DEFAULT_REGION} --stack-name Monolith --capabilities CAPABILITY_NAMED_IAM
Troubelshooting You can navigate to the AWS CloudFormation console, Click on the stack named Monolith and go to Events tab to understand the error if any while deploying the template.
Navigate to the AWS CloudFormation console.
Click on the stack named Monolith and go to Outputs tab
Select the Application Load Balancer link to open in a new tab.
Explore the monolith application and click on the tabs posts, threads and users.
While accessing the load balancer url, if you are getting error message 502 Bad gateway , wait for a minute for the EC2 instance to launch the container and register it to the load balancer. Refresh the load balancer url in the browser until you see the web application.