$ terraform -version
Terraform v0.12.21 + provider.aws v2.34.0
Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;
How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volume.foo as the resulting plan insists that it will?
- The aws console reports
Delete on terminationfor the volume's block device to befalse; - I've tried to
terraform destroy -target=aws_volume_attachement.foofirst;
... no-change. - I've tried removing the
aws_volume_attachmentfrom the configuration,terraform applyit and thenterraform destroy -target=aws_instance.foo;
... didn't help either
Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.
I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...
Can it be done?