<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: deborah-Cat</title>
    <description>The latest articles on DEV Community by deborah-Cat (@deborahcat).</description>
    <link>https://dev.to/deborahcat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F938078%2F0b988fcb-72f8-4a0c-a1ce-b9e16426cbfb.png</url>
      <title>DEV Community: deborah-Cat</title>
      <link>https://dev.to/deborahcat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deborahcat"/>
    <language>en</language>
    <item>
      <title>Need help ! Issue with Auto Scaling for Application Load Balancer with 2 different instances for target groups</title>
      <dc:creator>deborah-Cat</dc:creator>
      <pubDate>Thu, 03 Nov 2022 08:03:06 +0000</pubDate>
      <link>https://dev.to/deborahcat/need-help-issue-with-auto-scaling-for-application-load-balancer-with-2-different-instances-for-target-groups-gp0</link>
      <guid>https://dev.to/deborahcat/need-help-issue-with-auto-scaling-for-application-load-balancer-with-2-different-instances-for-target-groups-gp0</guid>
      <description>&lt;p&gt;What is your question/issue (provide as much detail as possible)?&lt;/p&gt;

&lt;p&gt;Hi All, I currently have an Application Load Balancer that has two rules :&lt;/p&gt;

&lt;p&gt;If the request is coming from a specific path Example: /test/, use a target group that points to an instance ( Let's say instance b ). For any other request use this target group ( another instance a ) In the autoscaling settings I have added these two target groups so that if autoscaling occurs and terminates the instances, they will be re-registered. This works correctly, however, I noticed that when termination happens the target group registers instance a where only instance b needs to be registered.&lt;/p&gt;

&lt;p&gt;I do have 2 ASGs, one for the instance a and one for another instance b. However, I mostly use the main site Load balancer as the rules are located there ( if the path of /test/* it uses the instance b ( target group ). The reason this was set like this is that the instance b is accessed by the main site domain. ( For example &lt;a href="http://www.example.com/test"&gt;www.example.com/test&lt;/a&gt; ) The desired count is set to 1.&lt;br&gt;
Since I'm using the ALB of the main site only when the ASG terminates the instance, a new target is registered for the main site in the target group of the instance b. My issue is that this target group should only register one instance and not 2 ( instance a ( main site ) and instance b )&lt;/p&gt;

&lt;p&gt;Would really appreciate some guidance, haven't received much from Re:post :(&lt;/p&gt;

&lt;p&gt;What technologies are you using?&lt;/p&gt;

&lt;p&gt;AWS, AutoScaling, EC2, ElasticBeanstalk&lt;/p&gt;

&lt;p&gt;What were you expecting to happen?&lt;/p&gt;

&lt;p&gt;When Autoscaling terminates the instance, the target group that has instance b registers, initiates another instance and places the same instance b and not another instance a. &lt;/p&gt;

&lt;p&gt;What is actually happening?&lt;/p&gt;

&lt;p&gt;When Autoscaling terminates the instance, the target group is adding another instance a and therefore the site breaks as the incorrect server is being shown.&lt;/p&gt;

&lt;p&gt;What have you already tried/thought about?&lt;/p&gt;

&lt;p&gt;Maybe having one autoscaling group for two different instances, however didn't manage. But there is still the issue of cannot control which instance is added to the target group when its terminated.&lt;/p&gt;

</description>
      <category>help</category>
      <category>aws</category>
      <category>ec2</category>
    </item>
  </channel>
</rss>
