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

Shell script resource to be re-created in each apply #129

Open ariannasg opened 8 months ago

ariannasg commented 8 months ago

We've found an issue with TF tracking changes to the script when there aren't any and after it has been successfully applied.

After some investigation, we concluded that this is due to the output that the shell_script resource is producing and that:

The simplest solution we found is to have final statement in the read function with an echo in JSON format, e.g.:

function read {
  echo "Running the shell script READ operation...";
  echo "Nothing to do";
  echo '{"read": "OK"}';
  return 0;
}

Can some documentation about this be added to the provider please? Thank you.