Elastic Beanstalk deployment failing because of a dangling security group

I found the Derya Sezen's related blog post AWS Elastic Beanstalk the security group having id does not exist problem that

  • was describing a case where old security group from a the previous environment was inherited to new environment (probably the case with me too)
  • adviced to update EB environment's security group options with AWS CLI

I run the following with AWS CLI following the blog post:

aws elasticbeanstalk update-environment --environment-name my-env-name --option-settings Namespace=aws:autoscaling:launchconfiguration,OptionName=SecurityGroups,Value=""

After that, EB updated the environments for a while and after that I was able to deploy successfully.


You can delete the problematic part by running eb config. You will receive editable config for your environment where you can find the non-existent security group and easily delete it.