0

Terraform Gurus, I am trying to delete one VM from a bunch of VMs. Right now, I have two VMs but that number could vary. I am looking for the ability to delete a specific VM. I am familiar with terraform destroy command but puzzled by why it's unable to recognize the match. I am running the below version on Apple M1 mac

% terraform --version
Terraform v1.5.4
on darwin_arm64


% terraform state list |grep -i instance

module.gce_instances.google_compute_instance.demo_gce[0]
module.gce_instances.google_compute_instance.demo_gce[1]


% terraform destroy -target module.gce_instances.google_compute_instance.demo_gce[1]
zsh: no matches found: module.gce_instances.google_compute_instance.demo_gce[1]
2
  • 3
    I'm guessing you need something like this: terraform destroy -target 'module.gce_instances.google_compute_instance.demo_gce[1]'. Commented Sep 28, 2023 at 14:28
  • That did it. Thanks a million @MarkoE Commented Sep 28, 2023 at 15:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.