Quickly Set Up AWS Global Accelerator Distribution for EC2 & ALB

Amazon Web Services (AWS) Global Accelerator is a powerful service designed to improve the availability and performance of your cloud applications by routing traffic over the AWS global network. Whether you’re using Application Load Balancers (ALB) or Elastic Compute Cloud (EC2) instances as endpoints, this guide provides clear, step-by-step instructions for setting up AWS Global Accelerator.

Setting up AWS Global Accelerator for EC2 instances or Elastic IP addresses

In some cases, you may want to route traffic directly to EC2 instances or Elastic IP (EIP) addresses. Here’s how to set up AWS Global Accelerator for these endpoints. 

Architecture diagram of AWS Global Accelerator with EC2
Architecture diagram of AWS Global Accelerator with EC2

Step 1: Creating an EC2 Instance in two different regions 

Make sure you have at least two EC2 instances set up in various regions before you start. You can create one instance in the US region and another in the Singapore region. This way, when users make requests, they will automatically be directed to the nearest AWS region. 

Go to EC2 services.

Click on Launch Instances.

Configure your instance settings.

Launch the EC2 instance.

I have two instances in two different regions.  

Instance One in the US region
Instance One in the US region
Instance Two in the Singapore region
Instance Two in the Singapore region

Step 2: Creating a Global Accelerator

Navigate to the AWS Global Accelerator console.

Accessing the AWS Global Accelerator service

Click on “Create accelerator”.

Creating global accelerator

Choose a name for your accelerator.

Select “Standard” as the Accelerator type.

(If you want a simple, automated solution to direct traffic to the nearest healthy endpoint, go with the “Standard” accelerator. If you need more control to route different types of traffic to specific EC2 instances based on custom criteria, then the “Custom Routing” accelerator is the choice for you.)

Select the IP address type as IPV4. 

Adding global accelerator basic configuration

Click on Next.

Step 3: Adding Listeners on AWS Global Accelerator. 

Then we have to set up a listener which is the port. 

Add “80” in the port and select “TCP” as the protocol because we will have the HTTP traffic which is built on top of TCP.  Also, select Client affinity as “NONE”. 

Then click on “Next”.

Adding global accelerator listeners

Step 4: Adding Endpoint groups on AWS Global Accelerator. 

In the endpoints group, select the instances that you have created. Select the region in which you have your first instance. In my case, it’s us-east-1. 

In the traffic dial choose “100”. Which means 100% of the traffic will go to that region.

Adding the first endpoint group

In the configure health checks tab. Add health check port as “80”, health check protocol as “HTTP”, health check path as “/”, health check interval as “10” and threshold count as “3”. 

Configuring health check

Now, click on “Add endpoint group” as we are going to add a second EC2 in another region. 

Adding a second endpoint group

Select the region in which you have your second instance. In my case, it’s ap-southeast-1.

Configure the health check which will be the same as above. 

If you have more EC2 in different regions then you can again click on “Add endpoint group” and repeat the same step as above. 

Then click on “Next.”

Adding second endpoint group details

Step 5: Adding endpoints on AWS Global Accelerator. 

Now we will have two endpoint groups. In the endpoint group 1, click on ”Add endpoint.”

Adding endpoint in first endpoint group

Select the endpoint type as “EC2 instance”. (If you have an elastic IP address then select “Elastic IP address” as an endpoint type and choose your elastic IP as an endpoint.)

Select your EC2 instance in Endpoint. 

Adding EC2 endpoint in first endpoint group

Now in the endpoint group 2, click on ”Add endpoint.”

Adding endpoint in second endpoint group

Select the endpoint type as “EC2 instance.”  (If you have an elastic IP address then select “Elastic IP address” as an endpoint type and choose your elastic IP as an endpoint.)

Select your EC2 instance in Endpoint. 

Adding EC2 endpoint in second endpoint group

If you have more endpoints then you can add them as well.

Click on “Create Accelerator”.

Your accelerator will be created successfully.

Global Accelerator was created successfully

Now you can see two static IP addresses, these two are going to be global anycast IP addresses to access the application. 

You also have the associated DNS name with this global accelerator. You can use both of them to access the global accelerator. 

Two static IP address and DNS name

Wait for the status to be “Deployed”. It can take a few minutes. 

Now you can copy the DNS name and check it. 

Step 6: Access the EC2 instances from Global Accelerator. 

I am testing it from Asia, which is near the Singapore region and I am redirected to the Singapore region.

Global Accelerator redirected to the Singapore region
Global Accelerator redirected to the Singapore region

Let’s also check it from the country that is near the US. 

Global Accelerator redirected to the US region
Global Accelerator redirected to the US region

Your AWS Global Accelerator is now set up to distribute traffic directly to your EC2 instances.

Setting Up AWS Global Accelerator for Application Load Balancers

In some cases, you may want to route traffic to the Application Load Balancer (ALB). Here’s how to set up AWS Global Accelerator for these endpoints.

Architecture diagram of AWS Global Accelerator with ALB
Architecture diagram of AWS Global Accelerator with ALB

Prerequisites

You must have at least two Application Load Balancer and associated target EC2 instances in two different regions. I have two ALBs in two different regions:

ALB One in the US region
ALB One in the US region
ALB Two in the Singapore region
ALB Two in the Singapore region

Step 1: Creating a Global Accelerator

Navigate to the AWS Global Accelerator console.

Accessing the AWS Global Accelerator service

Click on “Create accelerator”.

Creating global accelerator

Choose a name for your accelerator.

Select “Standard” as the Accelerator type.

(If you want a simple, automated solution to direct traffic to the nearest healthy endpoint, go with the “Standard” accelerator. If you need more control to route different types of traffic to specific EC2 instances based on custom criteria, then the “Custom Routing” accelerator is the choice for you.)

Select the IP address type as IPV4. 

Adding global accelerator basic configuration

Click on Next.

Step 2: Adding Listeners on AWS Global Accelerator. 

Then we have to set up a listener which is the port. 

Add “80” in the port and select “TCP” as the protocol because we will have the HTTP traffic which is built on top of TCP.  Also, select Client affinity as “NONE”. 

Then click on “Next”.

Adding global accelerator listeners

Step 3: Adding Endpoint groups on AWS Global Accelerator. 

In the endpoints group, select the instances that you have created. Select the region in which you have your first instance. In my case, it’s us-east-1. 

In the traffic dial choose “100”. Which means 100% of the traffic will go to that region.

Adding the first endpoint group

In the configure health checks tab. Add health check port as “80”, health check protocol as “HTTP”, health check path as “/”, health check interval as “10” and threshold count as “3”. 

Configuring health check

Now, click on “Add endpoint group” as we are going to add a second EC2 in another region. 

Adding a second endpoint group

Select the region in which you have your second instance. In my case, it’s ap-southeast-1.

Configure the health check which will be the same as above. 

If you have more EC2 in different regions then you can again click on “Add endpoint group” and repeat the same step as above. 

Then click on “Next.”

Adding second endpoint group details

Step 4: Adding ALB as endpoints on AWS Global Accelerator. 

Now we will have two endpoint groups. In the endpoint group 1, click on ”Add endpoint.”

Adding endpoint in first endpoint group

Select the endpoint type as “Application Load Balancer.”

Select your first ALB in Endpoint. 

Adding ALB endpoint in first endpoint group

Now in the endpoint group 2, click on ”Add endpoint.”

Adding endpoint for ALB in second endpoint group

Select the endpoint type as “Application Load Balancer.” 

Select your second ALB in Endpoint. 

Adding ALB endpoint in second endpoint group

If you have more endpoints then you can add them as well.

Click on “Create Accelerator.”

Your accelerator will be created successfully.

Global Accelerator for ALB was created successfully

Now you can see two static IP addresses, these two are going to be global anycast IP addresses to access the application. 

You also have the associated DNS name with this global accelerator. You can use both of them to access the global accelerator.

Two static IP address and DNS name for ALB

Wait for the status to be “Deployed”. It can take a few minutes. 

Now you can copy the DNS name and check it. 

Step 5: Access the ALB from Global Accelerator. 

I am testing it from Asia, which is near the Singapore region and I am redirected to the Singapore region.

ALB Global Accelerator redirected to the Singapore region
ALB Global Accelerator redirected to the Singapore region

Let’s also check it from the country that is near the US. 

ALB Global Accelerator redirected to the US region
ALB Global Accelerator redirected to the US region

Your AWS Global Accelerator is now set up to distribute traffic directly to your ALB.

Recommended Tool: ManageEngine OpManager

  • Multi-vendor Network Monitoring
  • Simple Installation & Setup
  • Intuitive UI
  • Complete Visibility
  • Intelligent Detections
  • Easy Resolutions

Leave a Reply

Your email address will not be published. Required fields are marked *