I need to create a snapshot of EBS volume using Terraform. I also have to consider that if the EBS volume has previously snapshots or not. If the EBS volume contains some previous snapshots then i need to delete them from my Terraform code and create a new snapshot of EBS volume.
I am not sure if deletion of resources is possible through Terraform code. If it is possible, how can i delete the previous snapshots and create new snapshot of EBS volume with Terraform.