- Newest
- Most votes
- Most comments
I understand you're having trouble terminating an Elastic Beanstalk environment that was created using Terraform. This is a common issue that can occur for various reasons, especially when there are associated resources or dependencies that are causing conflicts.
Based on the error message you've shared, it appears that there's an issue with an RDS database instance that's associated with your Elastic Beanstalk environment. The error suggests that the database instance no longer exists, which is causing the termination process to fail.
Here are some steps you can try to resolve this issue:
-
First, double-check that the RDS database instance mentioned in the error message has indeed been deleted. If it hasn't, try to delete it manually through the RDS console.
-
If the database has already been deleted but the Elastic Beanstalk environment is still failing to terminate, you may need to look at the underlying CloudFormation stack. Elastic Beanstalk uses CloudFormation to manage its resources, and sometimes issues can be resolved by interacting with the CloudFormation stack directly.
-
Try to find the CloudFormation stack associated with your Elastic Beanstalk environment in the CloudFormation console. Look for a stack with a name that includes your environment name.
-
If you find the associated CloudFormation stack, attempt to delete it directly from the CloudFormation console. This bypasses the Elastic Beanstalk layer and might succeed where the Elastic Beanstalk termination failed.
-
If the CloudFormation stack deletion also fails, you may need to manually delete some of the resources it's trying to remove. Pay attention to any error messages during the stack deletion process, as they can guide you to the problematic resources.
-
After successfully deleting the CloudFormation stack (if you were able to), check the Elastic Beanstalk console again. The environment may disappear on its own after some time.
-
If the environment is still stuck and showing a "No data" status, you might need to wait for a while (potentially up to an hour) for AWS to reconcile the state and remove the environment automatically.
If none of these steps work, you may need to contact AWS support for further assistance. They have additional tools and permissions to help resolve stuck resources.
Remember, after successfully terminating the environment, make sure to delete any associated CNAME mappings or DNS records to prevent dangling DNS entries, which can pose security risks.
Lastly, for future Terraform-managed resources, ensure that your Terraform state is kept in sync with the actual AWS resources to avoid discrepancies that can lead to termination issues.
Sources
Elastic Beanstalk environment does not terminate | AWS re:Post
After deleting Elastic Beanstalk application, environment still remains | AWS re:Post
Delete EB Env stuck with "no data" | AWS re:Post
Elastic Beanstalk | AWS re:Post
Relevant content
- asked a year ago
- asked 6 years ago
- asked a year ago