terraform-provider-terracurl
terraform-provider-terracurl copied to clipboard
Feature request: It would be great to have pre-post condition that can run a command or a resource
It would be great to have pre-post condition that can run a command or a resource for those isolated vault environments.. it'll save me from having to use a null resource local-provisioner for kubectl port-forward.
Thanks!
I discovered that a similar feature is actually generally implemented in Terragrunt https://terragrunt.gruntwork.io/docs/features/hooks/ Maybe it's possible to do it indirectly like including the pre-hook object in depends_on
Depending on the version of Terraform you are using, I believe if you add a lifecycle block to the resource, you'll get what you are after:
lifecycle {
postcondition {
condition = contains([201, 204], self.status_code)
error_message = "Status code invalid"
}
}
Ahh, but that wouldn't necessarily allow you to run a command - apologies.