You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if -y was aliased for -force for terraform destroy and -auto-approve for terraform apply
Actual Behavior
14:05 MacOS: Terraform/ $ terraform apply -y
flag provided but not defined: -y
Usage: terraform apply [options] [DIR-OR-PLAN]
Builds or changes infrastructure according to Terraform configuration
files in DIR.
By default, apply scans the current directory for the configuration
and applies the changes appropriately. However, a path to another
configuration or an execution plan can be provided. Execution plans can be
used to only execute a pre-determined set of actions.
Options:
... (removed for readability)
14:06 MacOS: Terraform/ $
Steps to Reproduce
terraform apply -y
or terraform destroy -y
Additional Context
I think that this would help developers in Staging and Development environments that can be stood up and torn down multiple times.
The text was updated successfully, but these errors were encountered:
Over in #17218 there is a change to make -auto-approve work on both terraform apply and terraform destroy.
We intentionally chose a very explicit name for this option because it's a dangerous option that should generally be used only in automation scenarios (where length of typing is not an issue). We don't want to have a single-character flag for something this dangerous.
The recommended workflow for interactive use is to type yes at the interactive prompt. I understand that this can be inconvenient if you are very rapidly creating an destroying a low-value environment, but Terraform's primary workflow designed with the common case of a high-value environment in mind.
If you have a codebase that has a workflow of frequent creating and destroy, I'd suggest optimizing that specific workflow with a codebase-specific wrapper script (or Makefile, etc) that includes the -auto-approve option. By including it in the relevant codebase you'd ensure that it can't be accidentally applied to a higher-value environment.
The current inconsistency between -force and -auto-approve will be addressed once #17218 is merged. I hope my rationale here for not implementing -y makes sense. Since we already have that PR open, I'm going to close this just to consolidate. Thanks again for opening this.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 4, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
This is not applicable
Debug Output
This is not applicable
Crash Output
This is not applicable
Expected Behavior
It would be nice if
-y
was aliased for-force
forterraform destroy
and-auto-approve
forterraform apply
Actual Behavior
Steps to Reproduce
terraform apply -y
or
terraform destroy -y
Additional Context
I think that this would help developers in Staging and Development environments that can be stood up and torn down multiple times.
The text was updated successfully, but these errors were encountered: