Creating an Application Load Balancer - sudo-arshia/tips_and_tricks GitHub Wiki

To efficiently distribute traffic to our WordPress instances, we will set up an Application Load Balancer (ALB) that points to a target group. This load balancer will evenly distribute incoming requests between the front-end WordPress instances, ensuring efficient utilization and improved availability. Let's walk through the process of creating an ALB using the AWS web console.

1. Accessing the Load Balancer Configuration

   - Navigate to the EC2 dashboard and scroll down to find the "Load Balancers" link in the left-hand navigation menu.

   - Click on the "Create Load Balancer" button located near the top of the screen.

2. Selecting Load Balancer Type

   - Choose the type of load balancer you want to create. In this case, select the "Application Load Balancer" option.

   - Provide a name for your load balancer. For this example, let's call it "WordPress".

   - Determine whether the load balancer will be internet-facing or internal. Since we want to balance traffic from the internet, select "internet-facing" for scheme.

   - Note that if you are using IPv6, you can create a dual-stacked ALB that supports both IPv4 and IPv6.

3. Configuring Listener and Availability Zones

   - Keep the default listener configuration, which sets HTTP on Port 80. You can add additional listeners, such as HTTPS, if required.

   - Select the VPC in which the ALB will operate. For this example, choose the Ohio Development VPC.

   - Specify the availability zones to which the ALB will direct traffic. To balance the load across all availability zones, select all available options.

4. Adding Tags and Security Group

   - In the Tags section, add a name tag for your load balancer, such as "WordPress".

   - Proceed to configure the security group. Choose an existing security group that allows HTTP traffic from anywhere to the development VPC. Ensure that the security group trusts traffic originating from itself.

5. Configuring Routing

   - The next screen prompts you to configure the target group for the ALB. Since we have already set up a target group, choose the "Existing group" option from the dropdown menu. This will populate the name dropdown with available target groups.

6. Registering Targets

   - Click the "Next: Register Targets" link in the lower right corner to proceed.

   - As the target group instances have already been defined, the next screen will display the instance IDs and associated ports. Verify that the information is correct.

7. Reviewing and Creating the ALB

   - Review all the information provided in the wizard on the review screen. This includes details such as internet-facing configuration, Port 80, VPC, and subnet IDs.

   - If everything appears correct, click the blue "Create" button to create the ALB.

   - Wait a few minutes for the ALB to be fully set up and ready to route traffic. Note that the provisioning process may take some time.

   - Once the process is complete, a success message will be displayed. Click the blue "Close" button to return to the load balancers configuration screen.

Congratulations! You have successfully created an Application Load Balancer (ALB) that will distribute traffic to the WordPress instances. The ALB will now play a crucial role in balancing the load and improving the availability and performance of your application.

Note: It's essential to monitor the ALB's state and ensure that it is fully provisioned before directing traffic to it.