Route Traffic to Multiple Target Groups using Load Balancer Listener Rules | AWS Load Balancing

  Рет қаралды 35,964

Tiny Technical Tutorials

Tiny Technical Tutorials

Күн бұрын

In a prior video ( • Create an Application ... ), we saw how to create a simple application load balancer that routed traffic to a single target group. But what if you have a more complicated use case? For example, what if you need to route GET and POST requests differently? Or route differently based on the user’s browser? Or the destination path? Or something in the query string?
For that, you’ll need to work with multiple target groups, setting up listener rules to route traffic to the appropriate place.
In this hands-on tutorial, I’ll walk you through how set up a load balancer that uses two target groups. The load balancer will route traffic based on listener rules that we’ll define.
🌟🌟If you’re interested in getting AWS certifications, check out these full courses. They include lots of hands-on demos, quizzes and full practice exams. Use FRIENDS10 for a 10% discount!
- AWS Certified Cloud Practitioner: academy.zerotomastery.io/a/af...
- AWS Certified Solutions Architect Associate: academy.zerotomastery.io/a/af...
00:00 - Overviewing the load balancer we’ll be building together
01:49 - Explaining the setup for the EC2 Instances
02:36 - Viewing the index.html pages for the EC2 instances
03:39 - Creating two target groups through the AWS Console
05:04 - Creating the application load balancer with a default HTTP listener
08:50 - Adding load balancer listener rules to route to a second target group
10:05 - Overviewing all six listener rule condition types (host-header, path-pattern, http-header, http-request-method, query-string, source-ip), with examples
11:14 - Creating a listener rule for query-string, forwarding to a second target group
13:03 - Creating a listener rule for http-header and User-Agent, forwarding to a second target group
14:40 - Editing and deleting listener rules
15:05 - Creating a listener rule for my source-ip, returning a fixed response for 403 forbidden
16:48 - IMPORTANT! Deleting your load balancer, target groups and EC2 instances

Пікірлер: 104
@radonspace2098
@radonspace2098 Жыл бұрын
You have no idea how your videos educate and elevate confidence levels. Thanks a million.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Wow, thank you! You made my day! :)
@user-el8pn7wb9p
@user-el8pn7wb9p 10 ай бұрын
Thanks for the clear explanation. I really love the way how you enjoy teaching things with a bright smile on your face. Makes the learning process more fun and easy.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 10 ай бұрын
Thanks for such a nice comment! Glad you're enjoying the videos! 🌟🙏😊
@jadeedstoresupport8916
@jadeedstoresupport8916 11 ай бұрын
I love videos like these where the creator really cares about the audience enough to go the extra miles and create content which is intuitive and easy-to-understand. Thanks to that Spirit of care. God bless.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 11 ай бұрын
Thanks so much...I really appreciate that! 🙏😊🔥🌟
@muhidrehman5645
@muhidrehman5645 Жыл бұрын
Hi Amber. Awesome tutorial. I cannot thank you enough for the work you do. I just love the way you explain in simple manner. Currently, I'm taking your AWS CCP course on ZMT and able to understand all the concepts. Thank you so much!! Keep up the good work!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Aww, thanks so much, Muhid! I'm so glad you're enjoying the course! :)
@umcoisas
@umcoisas Жыл бұрын
i need to say, this was the most incredible way to explain how this works, even after working several time with aws i never got to understand alb like now. tks!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
This makes me so happy!! Thanks for the nice comment! :)
@romihans
@romihans Жыл бұрын
Thanks for a clear and lucid explanation of using target groups with ALBs. Helped me clear up some doubts on using more than one target group
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Yay! I'm so glad it helped. Thanks for watching! 😊
@samjones4327
@samjones4327 Жыл бұрын
Awesome Awesome Awesome!!! You have a definite gift for explaining and teaching technical subjects! This tutorial is the best I've run across yet in my cloud practitioner studies. This subject could not have been explained and demoed better! Thank you so much once again and I'll see u in the next one!!! Cheers!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Sam - You are awesome, awesome, awesome for leaving such a nice comment!! Thanks so much...this made my day! Really glad you're enjoying the videos! :)
@samjones4327
@samjones4327 Жыл бұрын
@@TinyTechnicalTutorials You are very welcome!
@MostafaAhmed-fn1mn
@MostafaAhmed-fn1mn Жыл бұрын
Super simple and informative. Thank you!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You're welcome! Glad you liked it! :)
@lstgeorge7370
@lstgeorge7370 2 жыл бұрын
Tiny, your tutorials are awesome you make things look and sound so simple, i love it,,, keep the KISS principal :)
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Awww, shucks! Thanks so much for the nice comment, Louie! :)
@ouipro8903
@ouipro8903 Жыл бұрын
Extremely well explained and very efficient.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Al! I'm glad it helped! :)
@oluwaseunfashina1690
@oluwaseunfashina1690 Жыл бұрын
Teaching made simple ,As a beginners, I struggle to understand some hand on but with Tiny understanding is made simple, Thanks for taking time to make videos.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Awww, what a nice comment! Thanks so much, Oluwaseun! Glad you're enjoying the content. :)
@nadzhibkuziev8057
@nadzhibkuziev8057 Жыл бұрын
Thank you very much. Finnaly I have understood how listenners and target groups work.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Awesome! That's great to hear! Thanks for watching. :)
@vageeshanvageesh5583
@vageeshanvageesh5583 6 ай бұрын
Great one, clean and pin point information. Thanks Amber :)
@TinyTechnicalTutorials
@TinyTechnicalTutorials 5 ай бұрын
You're so welcome! Thanks for watching! 🙏🤓🌟
@theinnoverse
@theinnoverse Жыл бұрын
Beautifully explained!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much!! Really appreciate the nice comment. 😊
@m.furkanalperen7712
@m.furkanalperen7712 Жыл бұрын
That was very helpful video for me ! I can say from the bottom of my heart that you are awesome, thanks :)
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You're very welcome! So glad it helped! :)
@amolsakhare8327
@amolsakhare8327 5 ай бұрын
Your videos are helpful to understand basics and create more interest aws cloud.Thanks
@TinyTechnicalTutorials
@TinyTechnicalTutorials 5 ай бұрын
Yay! I'm so glad they're helping. Thanks for watching! 🤓🙏🌟
@hongli336
@hongli336 Жыл бұрын
Extremely well explained.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Jeff! Glad you enjoyed it! :)
@Learner-hg4hj
@Learner-hg4hj Жыл бұрын
Awesome and simplistic explanation ! Your teaching is unique and awesome as always , madam !! Appreciate your awesome lecture !
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks a lot! 😊 Glad it helped!
@cabracareca
@cabracareca Жыл бұрын
Awesome tutorial, thanks!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You're so welcome! Thanks for watching! 😊
@mirmali2710
@mirmali2710 Жыл бұрын
Amazing channel. Subscribed!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much! Welcome to the channel! 😊
@chamupathisaranga1438
@chamupathisaranga1438 Жыл бұрын
You are the one of the best teacher i have ever met on youtube.. your lessons are very clear and you have attractive voice also.. if you can please make more lessons like this about AWS..
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Ahhh, you're too kind!! So glad you enjoyed it! :) I'll definitely be doing more AWS videos, so stay tuned!
@chamupathisaranga1438
@chamupathisaranga1438 Жыл бұрын
@@TinyTechnicalTutorials thank you very much
@suzanalima9372
@suzanalima9372 Жыл бұрын
Thank you, this really help me ❤
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You're welcome! 😊 Thanks for watching!
@ramirez368
@ramirez368 Жыл бұрын
I found it pretty useful tutorial for getting the hang of ALB, but also liked your voice and how your explain things.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Cesar! I'm glad you enjoyed it! :)
@atuls4356
@atuls4356 Жыл бұрын
Perfect explanation 🙂
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Glad it was helpful! Thanks for watching! :)
@Don_Willy
@Don_Willy Жыл бұрын
Thank you so much.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You bet! Thanks for watching! 😊
@kanappilly
@kanappilly Жыл бұрын
Awsome tutorial. Looks like i can take AWS SAA C03 exam based on your tutorials.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Antony! 😊 There's definitely some good coverage of topics here on the channel. For full SAA prep, though, you can check out my course on Zero to Mastery: academy.zerotomastery.io/a/aff_464yrtnn/external?affcode=441520_lm7gzk-d. It goes into more depth, and also has lots of practice questions to help you prepare for the exam. Hope that helps! Let me know how the test goes. 😊
@DAndrewSaunders
@DAndrewSaunders 11 ай бұрын
great video👍
@TinyTechnicalTutorials
@TinyTechnicalTutorials 11 ай бұрын
Thank you! Cheers! 😊🙏
@harshalchoudhari3767
@harshalchoudhari3767 Жыл бұрын
Lab on alb was very clear... thank you
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You're welcome!
@harshalchoudhari3767
@harshalchoudhari3767 Жыл бұрын
I have question....can we receive http traffic on diff port for different target groups....if yes ..how could we do that ...?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Harshal! Yes, you can route traffic to different ports/different target groups. Here are a couple links that might help? stackoverflow.com/questions/56877149/aws-load-balancer-to-route-traffic-to-one-target-group-with-multiple-microservic stackoverflow.com/questions/61999337/aws-elb-routing-http-https-traffic-to-a-custom-port-of-ec2-instance bharathi-batthula6.medium.com/aws-applicationload-balancer-e03f4f386a9d
@harshalchoudhari3767
@harshalchoudhari3767 Жыл бұрын
Very thanks for guidance ☺️..
@rasbarbies
@rasbarbies Жыл бұрын
nice one...
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks for the visit! :)
@shomikhan1333
@shomikhan1333 5 ай бұрын
Thanks a lot, mam
@TinyTechnicalTutorials
@TinyTechnicalTutorials 5 ай бұрын
You're welcome! Thanks for watching!! 🙏🤓🌟
@musabsyd
@musabsyd Жыл бұрын
Superb
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thank you! Cheers!
@jitendernegi9074
@jitendernegi9074 11 ай бұрын
lovely
@TinyTechnicalTutorials
@TinyTechnicalTutorials 10 ай бұрын
Thank you, thank you!! 🙏🌟😊
@praveensequeira1525
@praveensequeira1525 10 ай бұрын
Hi, smooth as always, thank you! My questions for you: 1) If we add route 53 to the mix (referring to your video), will the DNS get resolved to the ip address of the load balancer or the actual instance that processed the incoming request? 2) My understanding is that we created the ALB nodes in multiple AZs - is this optional and for HA and fault-tolerance reasons. Or we could also choose to create a singular ALB node instance (in one of the AZs where our TGs/instances are running)? 3) If we chose to create ALBs (node) in multiple AZs, will the incoming traffic gets distributed to ALL of nodes (based on some algorithm) or is it only ONE node that still receives all the traffic and does the distribution to the TGs?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 9 ай бұрын
Hi Praveen! I haven't forgotten about this one! 😊 1) If you add Route 53, you'll want to create an "A" record/alias that points to the load balancer. While in theory you could point it to a specific instance if you knew the IP, the point of having a load balancer is so that IT can route traffic to the instances, it can do health checks, etc. (you can also set up an SSL certificate, use WAF on it, etc.). So pointing to the load balancer is the way to go. 2 & 3) For the application load balancer specifically (vs. network load balancer or classic load balancer), you're required to choose at least 2 AZs. There's a pretty good description/diagram here about how routing works across AZs: docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html Hope that helps!
@sraj7284
@sraj7284 6 ай бұрын
This is by far the best video I have come across on this topic! Well done, Amber! Thank you for lucidly explaining along. two questions: 1. At 13:00, if you kept hitting refresh, would it toggle the network traffic across the 2 instances in TG-2, or go to just that 1 instance? 2. How would you set this up so the network will randomly go to any of the instances across both the Target Groups? Thanks so much, Happy Holidays! 🙂
@TinyTechnicalTutorials
@TinyTechnicalTutorials 6 ай бұрын
Thanks for the nice comment, @sraj7284, and Happy Holidays to you too! 🎅🎄😊 1. It would toggle the traffic across the 2 instances in TG-2. 2. I'm not aware of a way to set it up to randomly distribute traffic across Target Groups. In the rules, you have to specify the % distribution for traffic, so it would adhere to those numbers. Hope that helps! 🤓
@sraj7284
@sraj7284 6 ай бұрын
@@TinyTechnicalTutorials Looks like I did not ask the right question. What I really wanted to ask was, how to distribute load across different AZs, because it appears that the nodes in each AZ will send traffic to just its own target groups. Looks like there is a setting called "Cross Zone Load Balancing" that sends traffic to all AZs. Its enabled by default. You would have to go to each target group to take it out of the Cross Zone load balancing, if you didn't desire this setting. Wish you a very happy, healthy, prosperous and fulfuling 2024 ahead! 🙂
@dineshmanogaran5289
@dineshmanogaran5289 Жыл бұрын
Time GOD..😍😍😍😍😍😍😍you are saved me
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
LOL!!! Glad it helped! 😃
@lucacapitoli2743
@lucacapitoli2743 8 ай бұрын
Very useful video!! Thanks so much! Is it possible do the same with a Network LB? How? Thanks!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
Thanks for the kind words, Luca! 😊🙏🌟 Glad you liked it! Yes, you can do a similar setup with a network load balancer, though the configuration is a bit more involved (protocols, ports, IPs, etc.). But maybe this will get you started? docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html
@lucacapitoli2743
@lucacapitoli2743 7 ай бұрын
​@@TinyTechnicalTutorials I mean, How Route UDP Traffic to Multiple Target Groups using Network Load Balancer filtering by host?
@user-in5zt6cc4k
@user-in5zt6cc4k 3 ай бұрын
i have one doubt can i add more listeners in a load balancer and connect it with different domains under one load balancer because when i try to do that i am getting another error when trying to access the response that the ssl remains to another domain that i have hosted first could you help me!.
@uzerahmed5163
@uzerahmed5163 11 ай бұрын
Thanks for the wonderful video ❤ just curious to know what is your main source of income?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 11 ай бұрын
Thanks so much, Uzer! I'm so glad it helped. 😊 Money comes from the money tree?? 🤑😏
@DM-ky4jw
@DM-ky4jw 11 ай бұрын
Hi, can we configure multiple target groups(different lambdas) in a single ALB and route traffic to secondary region for the failed target groups only
@TinyTechnicalTutorials
@TinyTechnicalTutorials 11 ай бұрын
Hi DM! 😊 Load balancers are region-specific, so it's not possible to route to a second region with *just* a load balancer. To go cross-region, you'll need to use Route 53 (which is a global service, and can therefore route across different regions). Here's some more information: docs.aws.amazon.com/whitepapers/latest/real-time-communication-on-aws/cross-region-dns-based-load-balancing-and-failover.html
@aayush481
@aayush481 Жыл бұрын
thanks a log for educating on this. One question, just to practice can we use personal aws account ? Wouldn't that cost high
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Aayush! Yes, you can use a personal AWS account. If it's a relatively new account, you should still be on the Free Tier for most things, and then some things are always free. Here's more detail if you want to check anything specific: aws.amazon.com/free Hope that helps! :)
@aayush481
@aayush481 Жыл бұрын
@@TinyTechnicalTutorials thanks a lot!
@galleon8129
@galleon8129 8 ай бұрын
Do security groups still hang around after deleting the instance using it?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
Ooh, good question! 🤓 Yes, they'll persist even after deleting the instance. You can have multiple instances using the same security group. So if Instance A and B were both using the same security group, you wouldn't it to be deleted if one of the instances was deleted.
@galleon8129
@galleon8129 8 ай бұрын
@@TinyTechnicalTutorials thanks, just remembered to delete them today to remove any confusion
@alishirdelan9488
@alishirdelan9488 10 ай бұрын
Is it possible to create one ALB for all services? I mean using Wildcard ALB with certificate for every services?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 10 ай бұрын
Hi Ali! 👋 It's technically possible to do this, but could make it more difficult to identify and troubleshoot if there are issues. And obviously there would be a single point of failure. There are some good points here in this thread to consider as well: stackoverflow.com/questions/65447698/aws-alb-single-for-all-services. Hope that helps! 😊
@alishirdelan9488
@alishirdelan9488 10 ай бұрын
@@TinyTechnicalTutorials Thank you very much for taking my question into consideration! I've checked the link you provided and I also want to extend my gratitude to them for sharing their ideas. I agree with you regarding the concern about a single point of failure. However, I also need to consider the trade-off between costs and complexity, as is often the case. Regardless, I greatly appreciate your videos and have learned a lot from them!
@alishirdelan9488
@alishirdelan9488 10 ай бұрын
@@TinyTechnicalTutorials ‌Hello Amber, another question comes up: Consider this: I would like to use a single set of EC2 instances and assign them to two or more target groups for utilization across two or three ALBs. Each ALB would have its corresponding target group, as these instances are meant to be allocated to two or three different target groups. This setup ensures redundancy: if one of the ALBs becomes unavailable, the others can continue functioning. Furthermore, all EC2 instances should remain reachable. Is this scenario reasonable, or are there drawbacks to consider? Given that DNS (Route 53) is internet-facing and the ALBs must be positioned behind other ALBs, the question arises of which services or load balancers should be interposed between the ALBs and DNS. Is it advisable to use wildcard DNS? In this context, the query remains: How can incoming traffic from external sources navigate through DNS and then be accurately directed to the correct ALB with its associated target groups?
@kesavanandt1195
@kesavanandt1195 Жыл бұрын
I love you.... 🥰
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
LOL! Thank you! 😊
@raju-mhds-123
@raju-mhds-123 Жыл бұрын
Hi Amber, You didn't showed the practical way of host & path based routing
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Raju! You're right...this video doesn't go into the rules for host- and path-based routing. Here are some links that might help instead: -Host-based: aws.amazon.com/premiumsupport/knowledge-center/elb-configure-host-based-routing-alb/ -Path-based: aws.amazon.com/premiumsupport/knowledge-center/elb-achieve-path-based-routing-alb/
@michaeltse321
@michaeltse321 Жыл бұрын
This is ok for conceptual understanding but default should be with HTTPS and not HTTP.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Yes! Great point. HTTPS in the real world, for sure! Thanks for the comment. 😊
@joemac84
@joemac84 Жыл бұрын
Every AWS tutorials seems to focus on the most basic example like HTTP target group on port 80.. Unfortunately not very helpful to the complexity of what needs to be done in real world production apps..
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks for the feedback, joemac! :)
@B3T0M4N
@B3T0M4N Жыл бұрын
I needed a refresher for ELB and this was exactly what I needed. You rock! AWS Ninja 🥷
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Yay! I'm so glad it helped, AWS Ninja! 😊💪🙌
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 31 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 11 МЛН
Amazon/AWS VPC (Virtual Private Cloud) Basics | VPC Tutorial | AWS for Beginners
9:50
Containers in AWS | For Absolute Beginners
7:37
Tiny Technical Tutorials
Рет қаралды 46 М.
Labour won, but what if Britain used proportional representation?
11:25
AWS Elastic Load Balancing Introduction
12:02
Stephane Maarek
Рет қаралды 127 М.
Неразрушаемый смартфон
1:00
Status
Рет қаралды 2,4 МЛН
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 178 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,7 МЛН