TL;DR
The configured destroy_cmd_entrypoint and destroy_cmd_body are not being invoked, even though the logs show the destroy was triggered and resource was removed from the .tfstate.
Expected behavior
On "destroy" (such as when TF needs to do a replace) the configured destroy_cmd_entrypoint and destroy_cmd_body should be invoked, similar to what happens on create, where the create_cmd_entrypoint and create_cmd_body are clearly invoked.
Observed behavior
Creates are doing as expected, calling the configured entrypoint, but destroys are not. The .tfstate data is indeed created and destroyed as expected, but the custom entrypoints are never getting invoked.
Terraform Configuration
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = "3.90.0"
}
}
}
provider "google" {
region = "us-central1"
project = "my-xxx"
credentials = "my-xxx-account.json"
}
# comment out the module below after "create" to get TF to "destroy"
module "my_xxx_tester" {
source = "terraform-google-modules/gcloud/google"
version = "3.1.0"
create_cmd_endpoint = "gcloud"
create_cmd_body = "version"
destroy_cmd_body = "gcloud"
destroy_cmd_body = "version"
}
Terraform Version
Terraform v1.1.5
on darwin_amd64
Debug Output
https://gist.github.com/crandall-chow-bl/b5a427c276f6c2c6be0d402304affe53
Additional information
Steps to Reproduce
- terraform apply with the TF file above to "create"
- Comment out the module in the TF file
- `terraform apply" with the TF file above to "destroy"
- Note that the destroy entrypoint/body do not get invoked
TL;DR
The configured
destroy_cmd_entrypointanddestroy_cmd_bodyare not being invoked, even though the logs show the destroy was triggered and resource was removed from the.tfstate.Expected behavior
On "destroy" (such as when TF needs to do a replace) the configured
destroy_cmd_entrypointanddestroy_cmd_bodyshould be invoked, similar to what happens on create, where thecreate_cmd_entrypointandcreate_cmd_bodyare clearly invoked.Observed behavior
Creates are doing as expected, calling the configured entrypoint, but destroys are not. The
.tfstatedata is indeed created and destroyed as expected, but the custom entrypoints are never getting invoked.Terraform Configuration
Terraform Version
Debug Output
https://gist.github.com/crandall-chow-bl/b5a427c276f6c2c6be0d402304affe53
Additional information
Steps to Reproduce