DEV Community

Cover image for Building A Highly Available Web Applications in AWS
gen2soulk
gen2soulk

Posted on

Building A Highly Available Web Applications in AWS

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.
  3. 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.
  1. To create the Application Load Balancer, click Update.
  2. In the left navigation pane, click Security Groups.
  3. In the Security Groups section, click Create security group. 22 . In the Basic details section, for the Security group name, type: **LoadBalancer **name
  4. For Description, type a description that you like, such as Allow access to the travel agency load balancer from the internet.
  5. For VPC, choose your VPC

_- To remove the existing VPC entry, you might need to click the X.
_

  1. In the Inbound rules section, click Add rule.
  2. Go to the next step.
  3. In the Inbound rules section, for Type, choose HTTP.
  4. To allow all inbound traffic, for Source, in the Custom search box, choose 0.0.0.0/0.
  5. In the Outbound rules section, for Type, choose HTTP.
  6. For Destination, choose the your security group.
  7. Remove the 0.0.0.0/0 destination.
  8. Scroll down to the bottom of the page.
  9. Click Create security group.
  10. In the left navigation pane, click Security Groups.
  11. In the Security Groups section, choose the check box to select the security group.
  12. On the Actions dropdown menu, choose Edit inbound rules.
  13. In the Inbound rules section, to remove the existing rule, click Delete.

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

  1. To add a new rule, click Add rule.
  2. For Type, choose HTTP.
  3. For Source, choose your LoadBalancer security group.
  4. Click Save rules.

  5. In the left navigation pane, click Load Balancers.

  6. In the Load balancers section, click your LoadBalancer.

  7. Scroll down to the Security tab.

  8. On the Security tab, click Edit.

  9. For Security groups, click the X icon to deselect the WebServer security group.

  10. Choose the LoadBalancer.

  11. Click Save changes.

  12. In the success alert, review the message.

  13. For the Application Load Balancer, under DNS name, click the copy icon to copy the provided name.

  14. 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.

Top comments (0)