fresh-refrigerator-73809
11/07/2022, 4:17 PMmysterious-teacher-68276
11/07/2022, 4:18 PMpath/to/terragrunt/repo
contain? Are there any .tf
, .tf.json
or .hcl
files in that folder?fresh-refrigerator-73809
11/07/2022, 4:18 PMmysterious-teacher-68276
11/07/2022, 4:19 PMterragrunt.hcl
file?fresh-refrigerator-73809
11/07/2022, 4:20 PMmysterious-teacher-68276
11/07/2022, 4:21 PMpath/to/terragrunt/repo
pathTerragrunt figures out the path to its config file according to the following rules:
1. The value of thecommand-line option, if specified.--terragrunt-config
2. The value of theenvironment variable, if defined.TERRAGRUNT_CONFIG
3. Afile in the current working directory, if it exists.terragrunt.hcl
4. Afile in the current working directory, if it exists.terragrunt.hcl.json
5. If none of these are found, exit with an error.
terragrunt-config
infracost breakdown --path
should point to either the path where your terragrunt.hcl
livesfresh-refrigerator-73809
11/07/2022, 4:29 PMmysterious-teacher-68276
11/07/2022, 4:31 PMinfracost breakdown
is?terragrunt.hcl
lives at the root directory, running infracost breakdown --path .
should workfresh-refrigerator-73809
11/07/2022, 4:35 PMinfracost breakdown --path plan.json --format json --out-file infracost.json
home/jenkins/agent/workspace/PR/root/dir/env/module/terragrunt.hcl:
mysterious-teacher-68276
11/07/2022, 4:37 PMinfracost breakdown --path plan.json --format json --out-file infracost.json
^ this doesn’t look correct - this is pointing to a plan JSON. Are you running another infracost cmd?fresh-refrigerator-73809
11/07/2022, 4:38 PMterragrunt run-all plan -out=tfplan
mysterious-teacher-68276
11/07/2022, 4:39 PMfresh-refrigerator-73809
11/07/2022, 4:41 PMmysterious-teacher-68276
11/07/2022, 4:43 PMinfracost breakdown --path /home/jenkins/agent/workspace/PR/root/dir
what is the error/output
2. if this errors - try running infracost breakdown --path /home/jenkins/agent/workspace/PR/root/dir --terraform-force-cli
fresh-refrigerator-73809
11/07/2022, 4:43 PMinfracost breakdown --path /home/jenkins/agent/workspace/PR/root/dir/env/ --terraform-force-cli
time="2022-11-07T17:47:08Z" level=info msg="Detected Terraform CLI at /home/jenkins/agent/workspace/PR/root/dir/env/"
time="2022-11-07T17:47:08Z" level=info msg="Starting: Running terraform plan"
Error: terraform plan failed: exit status 1
Terraform command failed with:
Error: No configuration files
Plan requires configuration to be present. Planning without a configuration
would mark everything for destruction, which is normally not what is desired.
If you would like to destroy everything, run plan with the -destroy option.
Otherwise, create a Terraform configuration file (.tf file) and try again.
mysterious-teacher-68276
11/07/2022, 7:57 PMinfracost breakdown --path /home/jenkins/agent/workspace/PR/root/dir --terraform-force-cli
needs to point to the directory with the terragrunt.hcl
file. It seems you are running it in the /home/jenkins/agent/workspace/PR/root/dir/env/
directoryfresh-refrigerator-73809
11/08/2022, 4:09 AMError: Failed to read the given file as a state or plan file
│
│ State read error: Error loading statefile: open output.log: no such file or
│ directory
│
│ Plan read error: open output.log: no such file or directory
╵
mysterious-teacher-68276
11/08/2022, 6:44 AMfresh-refrigerator-73809
11/09/2022, 12:21 AMmysterious-teacher-68276
11/09/2022, 8:30 AMinfracost breakdown
using this planfresh-refrigerator-73809
11/09/2022, 3:00 PMinfracost comment github --path "infracost.json" ...
infracost upload --path infracost.json
mysterious-teacher-68276
11/09/2022, 4:25 PMinfracost comment
should upload the results of the PR for you, so you don’t need a upload
stepfresh-refrigerator-73809
11/09/2022, 4:26 PMmysterious-teacher-68276
11/09/2022, 4:26 PMcomment
fresh-refrigerator-73809
11/09/2022, 4:27 PMmysterious-teacher-68276
11/09/2022, 4:27 PMfresh-refrigerator-73809
11/09/2022, 4:27 PMmysterious-teacher-68276
11/09/2022, 4:33 PMinfracost comment
step yet right?fresh-refrigerator-73809
11/09/2022, 4:33 PMError: required flag(s) "github-token", "repo" not set
mysterious-teacher-68276
11/09/2022, 4:34 PMinfracost comment github --path=infracost.json \
--repo=$GITHUB_REPOSITORY \
--pull-request=$PR_NUMBER `# or --commit=$GITHUB_SHA` \
--github-token=$GITHUB_TOKEN \
--behavior=update
fresh-refrigerator-73809
11/09/2022, 4:34 PMmysterious-teacher-68276
11/09/2022, 4:34 PMfresh-refrigerator-73809
11/09/2022, 4:36 PMmysterious-teacher-68276
11/09/2022, 4:44 PM--github-api-url
flag on comment