gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.01k stars 971 forks source link

Option to execute apply even if my before_hook fails #555

Open bfleming-ciena opened 6 years ago

bfleming-ciena commented 6 years ago

I tried to use run_on_error inside the extra_arguments block, because I wanted to do a before_hook that would create my tf workspace with terraform workspace new. But if the workspace already exists, then terragrunt won't continue and execute apply. I want to say it is safe to execute apply if my before_hook fails.

brikis98 commented 6 years ago

I don't think that's currently supported. I suppose we could add support for an ignore_errors = true param in hooks that says to ignore the exit code of the hook and keep running things (including the call to Terraform itself) even if a hook fails. PR welcome.