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

auto-approve for terragrunt destroy not working #3119

Open
gercograndia opened this issue May 6, 2024 · 4 comments
Open

auto-approve for terragrunt destroy not working #3119

gercograndia opened this issue May 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@gercograndia
Copy link

Describe the bug

After upgrading to the latest version of terragrunt, when running terragrunt destroy -auto-approve it still keeps asking for approval.

Steps To Reproduce

terragrunt --version
terragrunt version v0.58.2terragrunt destroy -auto-approve --terragrunt-no-auto-approve=false
Detected dependent modules:
xxx
WARNING: Are you sure you want to continue? (y/n)

Expected behavior

If you pass the -auto-approve flag, it should destroy without asking for approval.

Using plain terraform is does without complaining:

terraform --version
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/azuread v2.48.0
+ provider registry.terraform.io/hashicorp/azurerm v3.101.0
+ provider registry.terraform.io/hashicorp/random v3.6.1
+ provider terraformprovider.z6.web.core.windows.net/eon/eoncms v5.0.1

Your version of Terraform is out of date! The latest version
is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.htmlterraform destroy -auto-approve -var-file terragrunt-debug.tfvars.json
...
Destroy complete! Resources: 15 destroyed.

Versions

  • Terragrunt version: see before
  • OpenTofu/Terraform version: see before
  • Environment details (Ubuntu 20.04, Windows 10, etc.): macos Sonoma
@gercograndia gercograndia added the bug Something isn't working label May 6, 2024
@CristianoOliveira1
Copy link

CristianoOliveira1 commented May 6, 2024

This works for me (still asks for confirmation if there are dependent modules)
terragrunt destroy -auto-approve

and for all..
terragrunt run-all --terragrunt-non-interactive destroy

@gercograndia
Copy link
Author

So you're saying the auto-approve works as intended but if there are dependent modules there will always be a request for confirmation?

So in my view the auto-approve is doing half of its job then.

@CristianoOliveira1
Copy link

CristianoOliveira1 commented May 7, 2024

yes, was also surprised with that behaviour. but when using destroy for the whole set of modules, ( "terragrunt run-all --terragrunt-non-interactive destroy" ) it worked.

@gercograndia
Copy link
Author

Ok, I do believe this is somewhat a workaround and the auto-approve should just auto-approve.

But glad there is a workaround at least, so we can move on.

Thanks for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants