I have a ROOT_MODULE with main.tf:
#Root Module - Just run the script
resource "null_resource" "example" {
provisioner "local_exec" {
command = "./script.sh"
}
and script.sh:
echo "Hello world
now I have another directory elsewhere where I've created a CHILD_MODULE with another main.tf:
#Child Module
module "ROOT_MODULE" {
source = "gitlabURL/ROOT_MODULE"
}
I've exported my planfile: terraform plan -out="planfile"
however, when I do terraform apply against the planfile, the directory I am currently in no longer has any idea where the script.sh is. I need to keep the script in the same directory as the root module. This script is also inside a gitlab repository so I don't have a local path to call it. Any idea as to how I can get this script into my child module / execute it from my planfile?
Error running command './script.sh': exit status 1. Output: cannot access 'script.sh': No such file or directory