Amazon-web-services – Amazon Web Service can’t delete an Elastic Beanstalk environment


I have a problem with AWS Elastic Beanstalk. I tried to delete an environment. It started the process, but after a few minutes the environment "health bar" went to grey and gave me the following errors:

"Deleting security group named: XXXXX failed Reason: resource YYYYY has a dependent object"
"Stack deletion failed: The following resource(s) failed to delete: [AWSEBSecurityGroup]."

I tried to delete the security group from the error message, but I got this:

"XXXXXX: resource XXXXX has a dependent object"

After this I wanted to delete the dependence from the EB environment, but because it's Grey, it didn't allow me to do that.

I browsed the internet for hours, found a possible solution, where I need to do something at the EC2's Network Interfaces page, but it doesn't say any specific option or information.

Best Solution

Try this, I was suggested by AWS support and it worked for me.

  • You need to go to your CloudFormation console and retry deletion of the CloudFormation stack which the Beanstalk environment used.
  • The deletion may fail, but after retrying it will prompt you if you want to skip the "AWSEBRDSDatabase" resource that failed to delete. You can just confirm that you want to skip deletion (since you have actually already deleted it).
  • This should remove the CloudFormation stack
  • Then you can retry deletion of the Beanstalk environment from the Beanstalk console.
Related Question