tftarget icon indicating copy to clipboard operation
tftarget copied to clipboard

Selecting multiple resources on destroy fails

Open jimsmith opened this issue 1 year ago • 3 comments

When selecting more than one resource from the list, it fails to destroy as shown below:

My workaround is to select each resource individually then destroy one at a time.

$ tftarget destroy
? Select resources to target destroy: module.Stack.module.Compute.aws_instance.server[0] will be destroyed, module.Stack.module.Compute.aws_instance.server[1] will be destroyed
Enter a value: yes
â•·
│ Error: Invalid target "{module.Stack.module.Compute.aws_instance.server[0],module.Stack.module.Compute.aws_instance.server[1]}"
│
│ Must begin with a variable name.
╵

For more help on using this command, run:
  terraform destroy -help
==============🎉 Selected Resources 🎉==============
module.Stack.module.Compute.aws_instance.server[0] will be destroyed
module.Stack.module.Compute.aws_instance.server[1] will be destroyed

$  tftarget --version ; terraform --version
tftarget version 0.0.2 (Built on 2023-05-30 11:50:17.568382767 +0100 BST m=+0.001186340)
Terraform v1.4.6
on linux_arm64
+ provider registry.terraform.io/datadog/datadog v3.23.0
+ provider registry.terraform.io/hashicorp/aws v4.64.0
+ provider registry.terraform.io/hashicorp/local v2.4.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/tls v4.0.4

jimsmith avatar May 30 '23 10:05 jimsmith