Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

How to Create a Target Group and Associate with Load Balancer

Posted in AWS Tutorial
Updated on Sep 22, 2024
By Mari Selvan
👁️ 263 - Views
⏳ 4 mins
💬 1 Comment
How to Create a Target Group and Associate with Load Balancer

Photo Credit to CodeToFun

🤔 What is Target Group? #

A target group tells a load balancer where traffic should be sent, such as to EC2 instances, fixed IP addresses, or AWS Lambda functions. You create one or more listeners and configure listener rules to direct traffic to one target group when creating a load balancer.

Purpose of Target Group #

Take a look at the image below from bottom to top.

URL prefix method
  1. Our website is hosted on four EC2 instances.
  2. We used two Target Groups (Blue Target Group and Green Target Group) to connect a load balancer to four EC2 instances.
  3. Assume we have written a Target Group rule as follows:
    • Blue Target Group is listening to port 80 (HTTP request).
    • Green Target Group is listening to port 443 (HTTPs request).
  4. If a user sends an HTTP request, the Blue Target Group will listen for it and redirect it to the Instances specified for it.
  5. If a user sends an HTTPs request, the Green Target Group will listen for it and redirect it to the Instances specified for it.
  6. Congratulations, we now understand what Target Group is all about.

🤔 How to Create a Target Group? #

  1. Navigate to the Target Group section and click on the Create Target Group button.
    Create Target Group Button

    Photo Credit to CodeToFun

  2. Include the necessary EC2 instance in the Target Group by clicking on the Include as pending below button.
    Include Pending EC2 Instance

    Photo Credit to CodeToFun

  3. Congratulations, you have successfully created a Target Group, but it is not associated with any Load Balancer.
    Linking Target Group and Load Balancer

    Photo Credit to CodeToFun

  4. Learn how to create a load balancer and associated with this target group.

Did You Know?

did you know

Did you Know?

Target group allows developers to control how to distribute traffic to multiple versions of their application.

👨‍💻 Join our Community:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.

Buy me a coffee to make codetofun.com free for everyone.

Buy me a Coffee

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mari Selvan
Mari Selvan
1 year ago

If you have any doubts regarding this article (How to Create a Target Group and Associate with Load Balancer), please comment here. I will help you immediately.

We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy