4

I got the below error when terminating an EC2 instace, expecting another to spawn and replace it.

Auto Scaling activity failed 81 seconds ago with error: The security group 'X' does not exist in VPC 'Y'. Launching EC2 instance failed. At 2018-05-08T20:27:56Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.

The Cause:

I think the problem is that after creating the EB environment, I changed the security group to another I had created, then deleted the default security group.

Now even though the EC2 instance is set to use the new security group (in EB console), it still seems to want the original default one to exist.

But I could be wrong.

I've Tried:

I've tried fixing this by specifying the group I want it to use in .ebextensions. But I'm still having the same issue.

option_settings:
  aws:ec2:vpc:
    VPCId: ...
    AssociatePublicIpAddress: 'true'
    ELBScheme: public
    ELBSubnets: ..., ...
    Subnets: ..., ...
  aws:autoscaling:launchconfiguration:
     SecurityGroups: XXX
tim_xyz
  • 11,573
  • 17
  • 52
  • 97

1 Answers1

0

Even i was facing same problem, later i created security group by going security group in Network and Security in Ec2 section.

create a Security group and select your default VPC .

then again while creating scaling group the security group of your VPC will be listed.

  • Hi! What exactly do you mean by, "then again while creating scaling group the security group of your VPC will be listed." ? – user2402616 Jul 15 '21 at 17:13