boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

terraspace all subcommand pass through terraform args doesn't work #303

Open exoaturner opened 1 year ago

exoaturner commented 1 year ago

Checklist

My Environment

Software Version
Operating System Ubuntu 22.04
Terraform v1.4.5
Terraspace v2.2.6
Ruby 3.1.2p20

Expected Behaviour

Be able to use terraspace all plan -destroy to be able to pass the -destroy arg to terraform. Thi would result in a plan to destroy for all stacks.

Current Behavior

Running terraspace all plan -destroy results in terraspace seeing --destroy as a stack.

Log: ERROR: No stacks were found that match: --destroy

Running terraspace all plan demo -destroy results in terraspace not passing the -destory arg

Log: terraspace plan demo: Plan: 1 to add, 0 to change, 0 to destroy.

Step-by-step reproduction instructions

Simply run any terraspace all subcommand and try to pass terraform args with explicitly setting a target stack.

Example Command: terraspace all plan -destroy Example Command: terraspace all plan demo -destroy

Code Sample

Any terraspace project will do.

Solution Suggestion

Maybe the argument mechanism could be changed so we have clear separation of parse through commands and it be fixed for the all subcommand?

Examples:

terraspace all plan -- -destroy terraspace all plan demo -- -destroy terraspace plan demo -- -destroy terraspace init demo -- -lock-timeout=0s etc...