Skip to main content

How to always run local-exec with Terraform

Sometimes there is a need to always run some terraform local-exec, so we can always execute a null_resource when doing an apply or applying it as a target.

So, how can you make sure to invalidate state for the null resource, so it always runs the local-exec script.

terraform apply -target=null_resource.docker_build

https://ilhicas.com/2019/08/17/Terraform-local-exec-run-always.html