hashicorp / hashicorp/tfc-workflows-tooling

tfci does not handle working directory with more than 1 level

Open
#108 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
58
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Hello,
I am currently facing an issue with tfci running in github actions.
I setup my Terraform cloud workspace directory to be `layer0/infrastructure/eks`
But tfci 1.3.0 command:
```
tfci -hostname= -token= -organization= run create -workspace=myworkspace -configuration_version=cv-xxxxxx -message= -plan-o
nly=true
```
returns
```
lstat /home/tfc-agent/.tfc-agent/component/terraform/runs/run-o2Mn1KYJt4F6TbGD/config/layer0
```

Only the root level of the working directory has been used.
If I trigger a run manually in Terraform cloud UI, no issue.

Full log:
```
tfci -hostname= -token= -organization= run create -workspace=pierre-eks-us-east-2 -configuration_version=cv-xxxx -message= -plan-o
nly=true
Created Run ID: "run-o2Mn1KYJt4F6TbGD"
Run Status: "plan_queued"
Run Status: "plan_queued"
Run Status: "errored"
-------------- Plan Log --------------
Terraform v1.7.5
on linux_amd64

Error: No Terraform configuration files found in working directory

Terraform requires configuration files to plan changes. Planning without a
configuration would mark everything for destruction, which is normally not what
is desired. If you would like to destroy everything, queue a destroy plan
instead. Otherwise, create a Terraform configuration file (.tf file), or check
that the working directory is set correctly on the workspace, and try again.
Operation failed: failed checking for terraform files: lstat /home/tfc-agent/.tfc-agent/component/terraform/runs/run-o2Mn1KYJt4F6TbGD/config/layer0: no such file or directory
```

Any idea?
Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.