Create an Auto Scaling Group that Works with an Application Load Balancer | Beginner AWS Tutorials

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 มิ.ย. 2024
  • In a prior video ( • Create an Application ... ), I showed you how to work with a simple application load balancer that routed traffic between two EC2 instances. But what if you need 20 instances? Or 200? How can you manage that without a lot of administrative overhead?
    The answer is auto scaling groups (ASGs)! ASGs can scale up and down automatically based on load. You just set up the parameters and rules, and the instances will be spun up or down for you. And this ties in seamlessly with an application load balancer, which we’ll be working with in this video.
    In this hands-on tutorial, I’ll walk you through how to create and configure an auto scaling group that works with an application load balancer and a single target group.
    🌟🌟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 - Reviewing what we learned previously about load balancers
    00:35 - Introducing auto scaling groups (ASGs)
    01:19 - Reviewing the demo setup so far
    01:58 - Reviewing the load balancer and target group in the AWS Console
    02:21 - Creating a new auto scaling group in the AWS Console
    02:38 - Creating a new launch template in the AWS Console
    04:33 - Resuming the creation of the auto scaling group
    07:28 - Viewing the instances and activity in an auto scaling group
    08:53 - Simulating an unhealthy EC2 instance in the auto scaling group
    16:48 - IMPORTANT! Deleting your auto scaling group and launch template
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 61

  • @TinyTechnicalTutorials
    @TinyTechnicalTutorials  ปีที่แล้ว +2

    What else do you want to learn about AWS? Let me know below in the comments!

  • @chetandhongade6464
    @chetandhongade6464 5 วันที่ผ่านมา

    Thanks this is very helpful and easy, it is hard to find such good videos now a days

  • @mkcraghead
    @mkcraghead 2 หลายเดือนก่อน

    I'm surprised that you don't have more likes. You are very organized, very clear and concise, and have a great vocal tone in your delivery. That's an 'A' in my book. Keep up the great work.👍

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  2 หลายเดือนก่อน

      Awwww...thanks so much!!! Really appreciate the support! 🙏🌟🤓

  • @thewonderonesie782
    @thewonderonesie782 9 หลายเดือนก่อน +1

    TTT, this is such an awesome video. Very helpful, to the point, without unnecessary fluff. I love it, thank you!

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  9 หลายเดือนก่อน

      Oh, fluff is the WORST!! 😂 Glad you enjoyed it. Thanks for supporting the channel! 🙏🌟💪

  • @ramirez368
    @ramirez368 7 หลายเดือนก่อน +1

    I like it....simple and to the point, that is how it should be thanks Tiny Technical Tutorials.

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  7 หลายเดือนก่อน +1

      Wow, thanks SO much!! Really appreciate the kind words! 🥰🙏🌟

  • @charlese9430
    @charlese9430 ปีที่แล้ว +2

    This was super helpful. Appreciate all your insight

  • @ValeriiVasianovych
    @ValeriiVasianovych 2 หลายเดือนก่อน

    Thank you so much! This is the best tutorial about Auto Scaling.

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  2 หลายเดือนก่อน +1

      I'm so glad it helped!! Thanks for watching, and for the nice comment! 🙏🤓🌟

  • @melroypereira6697
    @melroypereira6697 2 หลายเดือนก่อน

    You have a good teaching skill (It's a Gift).

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  2 หลายเดือนก่อน +1

      Awwww...thank you SO much!!! Really appreciate you supporting the channel! 🥰🙏

  • @gravisrinivas
    @gravisrinivas ปีที่แล้ว

    Hi, all your tutorials are simple and excellent

  • @kkahandal
    @kkahandal ปีที่แล้ว

    Excellent simple explanation 👏

  • @samjones4327
    @samjones4327 ปีที่แล้ว +1

    Awesome Awesome Once again!!! And wanted to let you know I passed My Cloud Practitioner exam yesterday!!! Thank you for all of your help and I look forward to you Solutions Architect material coming soon! Cheers!

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว +2

      SAM!! That's AMAZING!!! Congratulations!! Thanks for letting me know! I'm putting the final touches on the Architect course...and still have a reminder to let you know when it goes live. For now, go celebrate! :)

    • @samjones4327
      @samjones4327 ปีที่แล้ว

      @@TinyTechnicalTutorials Thank u so much! And I will do just that!!🎉

  • @penagondasrinivas2050
    @penagondasrinivas2050 ปีที่แล้ว

    Excellent explanation

  • @hannahchiamakaejimofor2571
    @hannahchiamakaejimofor2571 ปีที่แล้ว

    Thank you.. This was helpful

  • @user-ux1ih6pf6u
    @user-ux1ih6pf6u 9 หลายเดือนก่อน

    I just love the how you make everything so simple, as a Cloud Devops engineer managing other clients' aws infrastructure, I come to you to unclutter my brain with these services. Keep up the good work. Can you point me to a good aws route 53 and eks video? Thanks again

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  9 หลายเดือนก่อน

      Oh, you're too kind! 🥰 Thanks for such a nice comment. I'm glad the videos help!
      I have a Route 53 video here that you might like: th-cam.com/video/JRZiQFVWpi8/w-d-xo.html.
      I don't have any on EKS yet, but skimmed through a few videos on TH-cam. This one seems pretty easy to follow if you're just getting started: th-cam.com/video/CukYk43agA4/w-d-xo.html
      Hope it helps! Thanks again for supporting the channel! 🤓🌟🙏

  • @yoramlim6053
    @yoramlim6053 ปีที่แล้ว +1

    Hi TTT, your videos have helped me tremendously for school. In comparison to your previous Load Balancing video, where you created two original EC2 instances, is that step no longer necessary for Auto Scaling? It seems that with Auto Scaling, I no longer require the "original two EC2 instances" and just let Auto Scaling generate or destroy instances as long it meets the minimum number of instances I set. Thank you!

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว +1

      Hi Yoram! Thanks for the nice comment! I'm so glad the videos are helpful. :)
      You are correct...with Auto Scaling, the Auto Scaling Group handles creating/destroying the instances. That's one of the big benefits: you don't have to manually provision, configure, terminate, etc. It just magically happens based on the number of instances you set (or based on some metric like CPU usage, etc.). You got it!

    • @yoramlim6053
      @yoramlim6053 ปีที่แล้ว +1

      @@TinyTechnicalTutorials Ah ok I see. I will do more tinkering around then! Thanks again and take care!

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว +1

      You bet!

  • @rrp2600
    @rrp2600 6 หลายเดือนก่อน +1

    In simple setup like this would the 2 instances being running on different physical servers. Do you get that kind of redundancy even at the free tier.

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  6 หลายเดือนก่อน

      Hi @rrp2600! 👋 AWS does its best to distribute your instances in a way that they're spread across the underlying hardware, but you don't have a way to know the details for sure. However, you CAN influence placement by specifying a Placement Group. Here are more details for those: docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html. Hope that helps! 😊

  • @yixiao8241
    @yixiao8241 ปีที่แล้ว +1

    Hi, in the step of attaching the auto scaling to an existing load balancer. If you put two existing load balancer target groups there. What will happen? Will the instances created by the auto scaling going only into one of the group or both?

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว

      Hi Yi! Thanks for watching! 😊 If you associate two target groups with the Auto Scaling Group, when a new instance is created (by the ASG), it will be registered with both target groups. And when the instance is terminated, it will be de-registered from both target groups.
      Here are a couple links that might help:
      stackoverflow.com/questions/59916924/attaching-a-target-group-of-alb-to-an-auto-scaling-group
      stackoverflow.com/questions/48529074/how-is-target-groups-different-from-auto-scaling-groups-in-aws

  • @vijji8942
    @vijji8942 8 หลายเดือนก่อน +1

    Hello, I like your session on Load Balancer. I have a question - Did you create Private instance or Public facing instance? I have not seen you enabled a Public IP for the instance during Launch Configuration Template. Also you have not selected key pair for instance, so without key how an Instance gets connected?

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  8 หลายเดือนก่อน

      Hi Vijji! 👋 I've got "Auto-assign public IP" enabled for all my EC2 instances (under "Network Settings" when I go to create a new instance), so I didn't have to manually do that. I believe this is the default setting when creating things in the default VPC, though you can override it. And you're right about the key. You'll need that to log into the machine, but I didn't need to log in for that video so I skipped it. But it IS recommended that you have a key. Hope that helps! 😊

    • @vijji8942
      @vijji8942 8 หลายเดือนก่อน +1

      @@TinyTechnicalTutorials Thanks for your response!! I got it now. Appreciate your help!!

  • @navjyotbhosale4410
    @navjyotbhosale4410 ปีที่แล้ว +1

    Demo project for Autoscaling.

  • @asd855280
    @asd855280 ปีที่แล้ว +1

    Question, the security group you created for the launch template, you allow traffic from the world, which is not a best practice for using a load balancer, because clients can still directly access all EC2 instances. I was wondering what would be the architecture that the SG for backend EC2 only receive internet traffic from ALB

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว +1

      Hi @asd855280! 😊 It's a great question. You're 100% correct...in the real world, you wouldn't want to open up the security group to the world. You'd have "the world" hit a load balancer. Then for backend EC2 instances, yes, you can set up the security group to only allow traffic from the load balancer (when you set up the security group, there's an option to select "load balancer" rather than specifying a port range). Hope that helps. Thanks for watching!

    • @asd855280
      @asd855280 ปีที่แล้ว +1

      @@TinyTechnicalTutorials Thank you so much for this information.

  • @javiermadriz7834
    @javiermadriz7834 10 หลายเดือนก่อน +1

    If ELB is not used, instances are only incremented when an instance reaches 100% capacity?

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  10 หลายเดือนก่อน

      Hi Javier! 👋 There are actually several different ways you can scale (regardless of whether you're also running an ELB). It's possible to scale based on demand, like the capacity percentage you mention. That would be "Scale based on demand" mentioned here: docs.aws.amazon.com/autoscaling/ec2/userguide/scale-your-group.html#scaling-options. But there are other options as well. Really depends on the workload as to what makes most sense. Hope that helps. Thanks for watching! 🤓🙏

  • @bradtechitsolution9269
    @bradtechitsolution9269 4 หลายเดือนก่อน

    thank you. Where can I get the user Data?

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  4 หลายเดือนก่อน

      Hi Brad! 👋 Here you go!
      #!/bin/bash
      # User data for new EC2 instances
      # install httpd (Linux 2 version)
      yum update -y
      yum install -y httpd
      systemctl start httpd
      systemctl enable httpd
      echo "Hello World! This is $(hostname -f)" > /var/www/html/index.html

  • @RajeshKumarBahl
    @RajeshKumarBahl 7 หลายเดือนก่อน

    Hi, thanks for the tutorial. I tried setting up ASG but failed every time. The issues I am facing are:
    1. The instances getting created after creating the template are not getting auto registered in target group.
    2. If I try to open the URL for load balancer, I get the error: Bad Gateway.
    3. The "autocreated" instances are getting terminated of their on and new instances keep getting launched. This cycle of launch and termination keeps happening.
    Could you help in letting me know where I am missing anything ?

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  7 หลายเดือนก่อน

      Hi Rajesh! 👋 Hmmm...I haven't run across these issues before, but maybe some of these links will help?
      1. Check your instances and load balancer are in the same availability zone: stackoverflow.com/questions/59398798/automatically-registering-targets-with-a-target-group-in-aws
      2. Some common troubleshooting for "bad gateway" errors: repost.aws/knowledge-center/elb-alb-troubleshoot-502-errors
      3. I think this might be (??) related to the issues above?
      Hope this helps! Feel free to report back here with any solutions...I'm curious! 😊

    • @RajeshKumarBahl
      @RajeshKumarBahl 7 หลายเดือนก่อน

      @@TinyTechnicalTutorials Hi TTT, thanks for your response. The good news is that the major issue has been resolved. I feel that it was a mistake at my end while the template was prepared. Since the template creation process does not give any option to enable/disable the public IP of newly created EC2 instance, so whatever instances were getting created, none had the public IP allocated to them. I created a template from an existing EC2 and used in proceeding further. It worked perfectly - I tested by increasing the CPU utilization to more than the threshold defined in configuration and the new instances got created promptly i.e. scale out is happening as expected. However one last issue is still not resolved - when I reduced the CPU consumption to less than the threshold, none of the EC2 got terminated.That means the scale-in is still not happening. Would appreciate any help in getting scale-in configured properly.

  • @seacprogrammer8455
    @seacprogrammer8455 ปีที่แล้ว +1

    Hey great work thank you.
    What is the magic involved with VPC's and Ip Addresses / CIDR blocks?
    Although some Dev Ops tasks seem straightforward from exposure to CICD and Cloud Formation
    that VPC SubNet math is weird coming from a developer or App Arch point of view.
    I mean you didn't mention anything in this about Route 53 or NACLs or all that routing jazz that
    troubles me soo much specifically --->
    OK Never Mind you did it already thank you th-cam.com/video/7_NNlnH7sAg/w-d-xo.html
    How does one GROK that number after the slash / in a CIDR block ?
    So I make my VPC and I define some IP "RANGE" I pick a series of octets
    and want lets say 100 Ip Addresses TOTAL in the VPC and
    50 of those I want to segment into a private subnet and 50 to my
    public subnet .. Blah blah some used internally for blah blah OK yeah whatever ---
    How to 101 basics please ?
    I know how to...... massage route tables and define appropriate routes POINT for various resources ALBs etc etc
    but that initial set of and division of IP Addresses. THE SET UP
    Where/what is the simple formula to figure out
    000.000.0.0/ ?? Its not straight forward like octets 1-50 and 51-100 ... -- and then there is that damn slash mark.
    I'd basically be Dev Ops confident a-top Solutions Arch confident (AWS Certs) if I can master this concept please.
    -- Goes off to google "CIDR blocks and Ip address ranges for DevOps engineers , for Dummies, 101 Basics" AGAIN ! lol

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว

      Hey again, SeaC Programmer! 😊 Yeah, IP addresses/CIDR blocks can be hard to wrap your head around. In addition to that VPC video you found, I have another "basics" video about that very topic (little bit of overlap with the VPC video): th-cam.com/video/kRDtwr1dPpw/w-d-xo.html. Might help a little bit??

    • @seacprogrammer8455
      @seacprogrammer8455 ปีที่แล้ว +1

      @@TinyTechnicalTutorials thanks for the swift reply...
      Already outdated MCSD, current AWS CDA reviewing for the AWS SA Pro. thanks
      I stumbled upon this [ AWS VPC Basics ] and it was excellent thank you .
      th-cam.com/video/O3fgul-fJCk/w-d-xo.html

    • @TinyTechnicalTutorials
      @TinyTechnicalTutorials  ปีที่แล้ว

      Awesome--thanks! 😊