Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 227
Zolage Avatar asked Jun 30 '14 13:06

Zolage


People also ask

Can we delete the JSON policy from a S3 bucket created by Elastic Beanstalk?

When you use an Elastic Beanstalk application to create an S3 bucket, a policy is applied to the bucket that protects it from getting deleted accidentally. To delete the bucket, you need to delete the bucket policy first.


2 Answers

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.
like image 129
Mayank Avatar answered Sep 27 '22 17:09

Mayank


Is the security group being referenced by RDS or something in S3? If that is the case, you'll have to delete the dependency in either RDS or S3.

The error message is saying something outside of your environment is still using the security group and it can't be deleted for this reason.

like image 38
EFeit Avatar answered Sep 27 '22 16:09

EFeit