Problem with accessing a file that is created during dflook/terraform-apply@v1
#287
Replies: 1 comment
-
Your are right, this is because these are docker based actions. The github workspace is mounted in The best way to solve this would be to specify your path relative to the terraform root module using resource "local_file" "hosts_cfg" {
content = templatefile("${path.module}/templates/hosts.tpl",
{
vm_info = flatten([for v in module.deployment : v.instance_info])
configuration = var.configuration
}
)
filename = "${path.root}/hosts.cfg"
} The directory specified by the - name: Terraform apply
uses: dflook/terraform-apply@v1
with:
path: terraform
- name: Upload created inventory file
uses: actions/upload-artifact@v3
with:
name: inventory file
path: terraform/hosts.cfg |
Beta Was this translation helpful? Give feedback.
-
I have a problem with accessing a file that is created during the
dflook/terraform-apply@v1
run throughlocal_file
resource:According to the log, the file is created when running the command:
To my surprise, when I try to access the file using
I receive the message:
I modified my workflow and added a step that shows me the project tree after calling
dflook/terraform-apply@v1
. It turns out that the file that was supposedly created does not appear in the list of folders and files shown by usingtree
.I started wondering if this problem might be related to the fact that
dflook/terraform-apply@v1
is a docker-based action and the file is being deleted before it's even saved.On the other hand, doesn't Terraform verify the path specified in the file name attribute (
filename = "/home/runner/work/Repo/Repo/hosts.cfg"
)?What can I do to access the file and save it using
upload-artifact
?Beta Was this translation helpful? Give feedback.
All reactions