I am running Terraform using Terragrunt so I am not actually certain about the path that the terraform is invoked from.
So I am trying to get the current working directory as follows:
resource null_resource "pwd" {
triggers {
always_run = "${uuid()}"
}
provisioner "local-exec" {
command = "echo $pwd >> somefile.txt"
}
}
However the resulting file is empty.
Any suggestions?
Try
command = "echo $(pwd) > somefile.txt"