Alexy Pulivelil
Alexy Pulivelil

Reputation: 177

Terraform destroy not working for DB instances in AWS

I used terraform destroy. Then I got this msg and the DB instances are still there.

Error : DB Instance Final Snapshot Identifier is required when a final snapshot is required.

Do I need to create a snapshot. If so is it possible to do it directly in the console ?

Upvotes: 4

Views: 2750

Answers (2)

Carter
Carter

Reputation: 1294

It is also valid to manually delete the RDS. Terraform will pickup the change.

Upvotes: 1

Matthew Schuchard
Matthew Schuchard

Reputation: 28864

You can use the skip_final_snapshot argument to evade this behavior, which is what you implied you are seeking here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#skip_final_snapshot.

Add that argument with a true value to your aws_db_instance, apply the new config to update the DB instance, and then you can freely destroy without the error requiring the final snapshot.

Upvotes: 3

Related Questions