2

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.

4

1 回答 1

1

不,这是不可能的。但是,如果以前的快照是由 terraform 创建的,那么在应用最新版本之前运行terraform destroy就可以完成这项工作。但是,如果这些快照是通过 terraform 以外的其他方式创建的,则根本不可能使用 terraform 删除它们。

于 2018-11-04T06:29:10.290 回答