Skip to content

Selecting multiple resources on destroy fails #12

@jimsmith

Description

@jimsmith

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions