Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting multiple resources on destroy fails #12

Open
jimsmith opened this issue May 30, 2023 · 3 comments
Open

Selecting multiple resources on destroy fails #12

jimsmith opened this issue May 30, 2023 · 3 comments

Comments

@jimsmith
Copy link

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
@orangekame3
Copy link
Collaborator

@jimsmith
Thank you for your comment. If possible, could you paste the output when you run 'terraform plan' under that configuration setting?

@jimsmith
Copy link
Author

jimsmith commented May 30, 2023

@orangekame3 Unfortunately I can't do that as it's quite big and it's impossible to redact all confidential things and internal naming of resources,terraform plan works fine.

@orangekame3
Copy link
Collaborator

@jimsmith
Okay, I will check this issue. Thank you for your report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants