scottwinkler / terraform-provider-shell

Terraform provider for executing shell commands and saving output to state file
Mozilla Public License 2.0
279 stars 60 forks source link

Errors from `delete` command are swallowed #40

Closed jcarlson closed 4 years ago

jcarlson commented 4 years ago

I'm using this provider to wrap AWS API commands for resources that Terraform does not yet support natively in the AWS provider.

On destroy, my delete command threw an error, but the shell script provider swallowed it and marked the resource as destroyed.

It would appear that, unlike the create, read and update operations, delete does not check the exit code of the script.

IMHO, the delete operation should check the exit code and fail destruction of the resource if the script did not exit cleanly.

scottwinkler commented 4 years ago

okay that sounds like a good idea. In the meantime can you set TF_LOG to debug? At least that way you can still get logs for delete operation