Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elastic Beanstalk Environment termination failing due to non-existent RDS

I created an Elastic Beanstalk via the wizard and it made an an Amazon RDS database that I didn't use because we have our DB instances in a different RDS outside of Elastic Beanstalk.

I deleted the RDS instance which made the environment unstable and we couldn't use it anymore. However, we made a new environment and everything worked out.

Now, I am trying to terminate this other Beanstalk which we can't/won't use but it keeps failing the termination. As far as I could figure, it seems like when the RDS was created, the retention was set at 'take a snapshot', now that the RDS doesn't exist, it can't take a snapshot and fails terminating the environment.

All I need to do is get rid of this environment because it is just sitting there. How do I go about solving this problem?

For reference this is what the error logs look like:

2018-06-05 14:00:41 UTC-0500    ERROR   Stack deletion failed: The following resource(s) failed to delete: [AWSEBRDSDatabase].
2018-06-05 14:00:41 UTC-0500    ERROR   Deleting RDS database named: aa1ipjn4c8bwak9 failed Reason: DBInstance aa1ipjn4c8bwak9 not found. (Service: AmazonRDS; Status Code: 404; Error Code: DBInstanceNotFound; Request ID: f8f17442-bd41-4188-9c7e-9408a5398a92)
2018-06-05 14:00:24 UTC-0500    INFO    rebuildEnvironment is starting.
2018-06-01 14:21:01 UTC-0500    ERROR   Stack deletion failed: The following resource(s) failed to delete: [AWSEBRDSDatabase].
2018-06-01 14:21:01 UTC-0500    ERROR   Deleting RDS database named: aa1ipjn4c8bwak9 failed Reason: DBInstance aa1ipjn4c8bwak9 not found. (Service: AmazonRDS; Status Code: 404; Error Code: DBInstanceNotFound; Request ID: 0dba0c59-473f-4814-a6dd-2af7847be6c0)
like image 311
shivangi kulshrestha Avatar asked Jun 05 '18 19:06

shivangi kulshrestha


People also ask

How do I allow Elastic Beanstalk to access RDS?

In the navigation pane, choose Configuration. In the Instances configuration category, choose Edit. Under EC2 security groups, choose the security group to attach to the instances, in addition to the instance security group that Elastic Beanstalk creates. Choose Apply.

Does Elastic Beanstalk use RDS?

You can use Elastic Beanstalk with Amazon Relational Database Service (Amazon RDS) to set up, operate, and scale a relational database.


2 Answers

You may be able to create a new RDS instance named aa1ipjn4c8bwak9 and then delete the environment. I had to do something similar when I switched from the default ELB to an ALB.

I wish that EB didn't default to creating a database with the environment - in any sort of production environment, it's almost certainly a bad idea.

like image 163
Brian Avatar answered Sep 23 '22 13:09

Brian


  1. Open the AWS CloudFormation console.

  2. In the navigation pane, choose Stacks.

  3. In the Stack name column, select the stack for the Elastic Beanstalk environment that you want to delete.

Note: In the Status column for your stack, you should see DELETE_FAILED.

Tip: You can identify your stack by verifying that the environment ID from the Description column in the AWS CloudFormation console matches the environment ID of your Elastic Beanstalk environment.

  1. Choose Delete.

  2. In the pop-up window, select the AWSEBRDSDatabase check box in the Resources to retain - optional section, and then choose Delete Stack.

Source:- AWS Knowledge Centre

like image 24
Christopher Nolan Avatar answered Sep 21 '22 13:09

Christopher Nolan