{"id":3673,"date":"2023-02-11T08:23:21","date_gmt":"2023-02-11T08:23:21","guid":{"rendered":"https:\/\/exceedthecloud.com\/?p=3673"},"modified":"2023-02-13T11:01:22","modified_gmt":"2023-02-13T11:01:22","slug":"auto-scaling-groups-asg-hands-on-with-aws-ec2","status":"publish","type":"post","link":"https:\/\/exceedthecloud.com\/?p=3673","title":{"rendered":"Auto Scaling Groups (ASG) Hands on with AWS EC2 instances"},"content":{"rendered":"\n<p>An Auto Scaling group is a collection of Amazon EC2 instances that are treated as a logical unit. You configure settings for a group and its instances as well as define the group\u2019s minimum, maximum, and desired capacity. Setting different minimum and maximum capacity values forms the bounds of the group, which allows the group to scale as the load on your application spikes higher or lower, based on demand. To scale the Auto Scaling group, you can either make manual adjustments to the desired capacity or let Amazon EC2 Auto Scaling automatically add and remove capacity to meet changes in demand.<\/p>\n\n\n\n<p>Prerequisite: Having a valid AWS Account (Follow the step in this link to create an AWS Account) <a href=\"https:\/\/exceedthecloud.com\/?p=3419\" target=\"_blank\" rel=\"noreferrer noopener\">How to Sign Up for a new Amazon Web Services Account<\/a><\/p>\n\n\n\n<p>Open the page: <a href=\"https:\/\/aws.amazon.com\/account\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/aws.amazon.com\/account\/<\/a><\/p>\n\n\n\n<p>From previous lab on load balancing, terminate all the EC2 instance currently running<\/p>\n\n\n\n<p>Select all EC2 instances and click on terminate instance<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"83\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture1-10.png\" alt=\"\" class=\"wp-image-3674\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture1-10.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture1-10-300x40.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Confirm by clicking on Terminate<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"311\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture2-10.png\" alt=\"\" class=\"wp-image-3675\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture2-10.png 534w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture2-10-300x175.png 300w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/figure>\n\n\n\n<p>Go to the menu and select Auto Scaling groups<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"291\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture3-10.png\" alt=\"\" class=\"wp-image-3676\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture3-10.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture3-10-300x140.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Click on Create Auto Scaling group<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"473\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture4-10.png\" alt=\"\" class=\"wp-image-3677\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture4-10.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture4-10-300x227.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Enter the Auto Scaling group name and Create a Launch template \/ Click Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"373\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture5-9.png\" alt=\"\" class=\"wp-image-3678\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture5-9.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture5-9-300x179.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Enter the Launch Template name and choose the options for your EC2 template (AMI image \/ Instance type \/ Key pair \/ Network settings \/ Storage and User data)<\/p>\n\n\n\n<p>Review all the option and click on Create launch template<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"467\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture6-9.png\" alt=\"\" class=\"wp-image-3679\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture6-9.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture6-9-300x225.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Confirm the template was created and go back to your auto scaling wizard<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"252\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture7-9.png\" alt=\"\" class=\"wp-image-3680\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture7-9.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture7-9-300x121.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Choose the new template and click Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"584\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture8-8.png\" alt=\"\" class=\"wp-image-3681\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture8-8.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture8-8-300x281.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Select the Availability Zones and subnet \/ Click Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"703\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture9-8.png\" alt=\"\" class=\"wp-image-3682\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture9-8.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture9-8-266x300.png 266w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Choose Attach to an existing load balancer \/ Select the existing Target Group \/ or create a new one<\/p>\n\n\n\n<p>Click on Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"689\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture10-8.png\" alt=\"\" class=\"wp-image-3683\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture10-8.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture10-8-272x300.png 272w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Configure the group size and scaling policies \/ Click on Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"678\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture11-8.png\" alt=\"\" class=\"wp-image-3684\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture11-8.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture11-8-276x300.png 276w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Click on Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"195\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture12-6.png\" alt=\"\" class=\"wp-image-3685\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture12-6.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture12-6-300x94.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Click on Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"397\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture13-5.png\" alt=\"\" class=\"wp-image-3686\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture13-5.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture13-5-300x191.png 300w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture13-5-80x50.png 80w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Review all the steps and click on Create Auto Scaling Group<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"564\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture14-7.png\" alt=\"\" class=\"wp-image-3687\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture14-7.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture14-7-300x271.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><figcaption class=\"wp-element-caption\">Confirm your ASG is successfully created with status updating<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"132\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture15-5.png\" alt=\"\" class=\"wp-image-3688\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture15-5.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture15-5-300x63.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Click on Instance Management to view the details on instances<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"253\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture16-4.png\" alt=\"\" class=\"wp-image-3689\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture16-4.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture16-4-300x122.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Confirm you have now two new instances created by ASG<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"103\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture17-4.png\" alt=\"\" class=\"wp-image-3690\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture17-4.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture17-4-300x50.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Open your load balancer url and confirm you have access to the web application<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"220\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture18-3.png\" alt=\"\" class=\"wp-image-3691\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture18-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture18-3-300x106.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Terminate one instance and see how ASG automatically provision a new instance<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"132\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture19-2.png\" alt=\"\" class=\"wp-image-3692\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture19-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture19-2-300x63.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"150\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture20-2.png\" alt=\"\" class=\"wp-image-3693\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture20-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture20-2-300x72.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Play with the ASG desired capacity (1) and maximum capacity (2) to see how the ASG is working by auto-provisionning new instances or terminate unnecessary instances<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"318\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture21-2.png\" alt=\"\" class=\"wp-image-3694\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture21-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture21-2-300x153.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"103\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture22-2.png\" alt=\"\" class=\"wp-image-3695\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture22-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture22-2-300x50.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Lab cleaning up<\/p>\n\n\n\n<p>Select the Auto Scaling group and delete it<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"115\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture23-2.png\" alt=\"\" class=\"wp-image-3696\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture23-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture23-2-300x55.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Confirm the deleting action<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"397\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture24-1.png\" alt=\"\" class=\"wp-image-3697\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture24-1.png 538w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture24-1-300x221.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<p>Select Load balancer and delete it<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"144\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture25-1.png\" alt=\"\" class=\"wp-image-3698\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture25-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture25-1-300x69.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Confirm that all the EC2 instances was terminated<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"360\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture26-1.png\" alt=\"\" class=\"wp-image-3699\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture26-1.png 537w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/Picture26-1-300x201.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/figure>\n\n\n\n<p>Credit: <a href=\"https:\/\/www.udemy.com\/user\/stephane-maarek\/\" target=\"_blank\" rel=\"noreferrer noopener\">Stephane Maarek<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An Auto Scaling group is a collection of Amazon EC2 instances that are treated as a logical unit. You configure settings for a group and its instances as well as define the group\u2019s minimum, maximum, and desired capacity. Setting different &hellip; <a href=\"https:\/\/exceedthecloud.com\/?p=3673\">Continued<\/a><\/p>\n","protected":false},"author":1,"featured_media":3700,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"kt_blocks_editor_width":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[121,118,123],"tags":[133,119,120,130],"class_list":["post-3673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-amazon-web-services","category-aws","category-aws-basics","tag-auto-scaling-groups","tag-aws","tag-aws-account","tag-ec2"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2023\/02\/scale9.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3673"}],"version-history":[{"count":5,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3673\/revisions"}],"predecessor-version":[{"id":3719,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3673\/revisions\/3719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/media\/3700"}],"wp:attachment":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}