If I consume a package of scripts in a terraform plan or apply step, it seems like the deploy.ps1 custom script file is not executed. From the look of your docs https://octopus.com/docs/deployment-examples/custom-scripts it is not clear if this is expected behavior or not? It would be useful to be able to do some scripting before the terraform step is executed but perhaps this is not supported?
Thanks for reaching out, Unfortunately this is the expected behavior, the custom scripts within the package are not executed when deployed with the Terraform steps. It is something that is up for discussion, and if you are up for it, it might be worth suggesting on our uservoice site.
I hope that helps, please let me know if you have any further questions.