Building A Highly Available Web Applications in AWS
Tags: aws, web, devops, developer
Published: 2024-01-24 11:21:05

This is a short article on how to build Highly Available Web Applications in AWS. 
**Summary Steps**

1. Migrate an Auto Scaling Group behind an Application Load Balancer in one Availability Zone.
2. Set up Load Balancer health monitoring for an Amazon EC2 Auto scaling group.
Add a second Availability scaling group to the Amazon EC2 Auto Scaling Group.
4. Configure an Auto scaling group to include a new EC2 instance in a third Availability zone.

** Step-by-step guide**
1. Visit your AWS Console page
2. In the top navigation bar search box, type: **ec2**
3. In the search results, under Services, click EC2.
4. In the left navigation pane, click Auto Scaling Groups.
5. In the Auto Scaling groups section, choose the check box to select your WebServers.
6. On the Details tab, review the current capacity details.
7. Click the Instance management tab.
8. Review to see that there is currently one instance in the Auto Scaling group.
9. Click the Details tab.
10. Scroll down to Network. 
11. In the Network section, review to see that the Auto Scaling group is configured with a single subnet from one Availability Zone. 
12. Scroll down to Load balancing.  
13. Click Edit. 
14. Click Add a new load balancer.
15. For Load balancer type, choose Application Load Balancer.
16. For Load balancer scheme, choose Internet-facing.
17. For Availability Zones and subnets, choose the three check boxes to select all three Availability Zones. 
18. On each of the three dropdown menus, choose the available public subnet.
19. For Default routing (forward to), choose Create a target group.

- **_Keep the defaults_**.

19. To create the Application Load Balancer, click Update.
20. In the left navigation pane, click Security Groups.
21. In the Security Groups section, click Create security group.
22 . In the Basic details section, for the Security group name, type: **LoadBalancer **name
23. For Description, type a description that you like, such as Allow access to the travel agency load balancer from the internet.
24. For VPC, choose your VPC

_- To remove the existing VPC entry, you might need to click the X.
_
25. In the Inbound rules section, click Add rule. 
26. Go to the next step.
27. In the Inbound rules section, for Type, choose HTTP.
28. To allow all inbound traffic, for Source, in the Custom search box, choose 0.0.0.0/0.
29. In the Outbound rules section, for Type, choose HTTP.
30. For Destination, choose the your security group.
31. Remove the 0.0.0.0/0 destination.
32. Scroll down to the bottom of the page.
33. Click Create security group.
34. In the left navigation pane, click Security Groups.
35. In the Security Groups section, choose the check box to select the security group.
36. On the Actions dropdown menu, choose Edit inbound rules.
37. In the Inbound rules section, to remove the existing rule, click Delete.

_**- You must delete the existing rule to modify the rule type.**_

38. To add a new rule, click Add rule.
39. For Type, choose HTTP.
40. For Source, choose your LoadBalancer security group.
41. Click Save rules.

42. In the left navigation pane, click Load Balancers.
43. In the Load balancers section, click your LoadBalancer.
44. Scroll down to the Security tab.
45. On the Security tab, click Edit.
46. For Security groups, click the X icon to deselect the WebServer security group.
47. Choose the LoadBalancer.
48. Click Save changes.
49. In the success alert, review the message.
50. For the Application Load Balancer, under DNS name, click the copy icon to copy the provided name.
51. In a new browser tab (or window) address bar, paste the DNS name that you just copied, and then add http:// to the beginning and press Enter.

_- The website is hosted only with HTTP.
_
- Congratulations! You have moved the travel agency website behind an Application Load Balancer.