Highly available and fault tolerant architecture via Elastic Beanstalk
AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS. You can simply upload your code and Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. At the same time, you retain full control over the AWS resources powering your application and can access the underlying resources at any time. This activity will cover the following objectives with Elastic Beanstalk: -Demonstrate the ability to provision load balancer -Demonstrate the ability to create Auto Scaling Group -Demonstrate the ability to set application platform
Highly Available and Fault Tolerant Architecture via Elastic Beanstalk
In this lab, we'll learn about highly available and fault tolerant architecture for Elastic Beanstalk applications.
This written guide focuses on the steps necessary to complete the lab. It is recommended that you watch the accompanying video guide for extra details, clarifications, and insights.
Set the Application Platform
First, we'll define what platform our application will use. To begin, log into the AWS console and select Elastic Beanstalk from the services list.
- Click the Get started button.
- For the application name, enter highly_available_fault_tolerant.
- For the environment name, enter test.
- From the platform menu, select Node.js.
- Click the Configure more options button at the bottom of the page.
Create an Auto Scaling Group
Next, we'll create an auto scaling group. This allows us to provision additional resources in response to increases in traffic.
- At the top of the page, select the High availability option.
- Below, find the Capacity section and click Modify.
- Ensure the environment type is set to Load balanced.
- Set the minimum number of instances to 2.
- From the avaialbility zones menu, select Any 2.
- Click the Save button.
Provision a Load Balancer
Now that we've set up auto scaling, we'll provision a load balancer. This ensures that traffic is distributed among our instances, ensuring its availability.
- Find the Load balancer section and click Modify.
- Review the options and click Save.
- Find the Network section and click Modify.
- From the VPC dropdown menu, select the preconfigured VPC.
- In the load balancer subnets section, select all of the availability zones by checking their boxes.
- Below, under the instance settings, check the Public IP address option.
- Select all three availability zones in the instance subnets section.
- In the instance security groups section, select default.
- Click the Save button.
- At the bottom of the page, click the Create app button.
Finally, we'll check to make sure everything has been set up properly.
- Once the app has been provisioned, navigate to the EC2 console and click Running instances.
- From the menu on the left, select Auto Scaling Groups. We should see that the auto scaling group was created with the specifications we provided.
- Navigate back to the Elastic Beanstalk dashboard.
- Click the name of the environment we created (test).
- Click the URL at the top of the page.
- We should see a "Congratulations" page, indicating that the app is running.
In this lab, we learned to create highly available, fault tolerant architecture using Elastic Beanstalk. For more information, we recommend following along with the video associated with this lab.