little-author-61621
glamorous-afternoon-18052
08/12/2021, 2:08 AMeager-twilight-45948
08/17/2021, 2:29 AMambitious-apple-63257
08/17/2021, 6:15 PMTerraform command failed with:
panic: value is marked, so must be unmarked first
goroutine 1 [running]:
<http://github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)|github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)>
/home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.4/cty/marks.go:141
<http://github.com/zclconf/go-cty/cty.Value.LengthInt|github.com/zclconf/go-cty/cty.Value.LengthInt>(0x2cbab00, 0xc001b1ed70, 0x25536a0, 0xc001b089f0, 0x2cbab01)
/home/circleci/go/pkg/mod/github.com/zclconf/go-cty@v1.8.4/cty/value_ops.go:1050 +0x4f
The command I'm using with infracost is: INFRACOST_TERRAFORM_WORKSPACE=$WORKSPACE TF_WORKSPACE=$WORKSPACE INFRACOST_TERRAFORM_BINARY=terraform$ATLANTIS_TERRAFORM_VERSION infracost diff --log-level warn --no-color --path $PLANFILE || true
white-airport-8778
flaky-architect-33900
08/27/2021, 6:02 AMproud-megabyte-80421
09/24/2021, 11:24 AMproud-megabyte-80421
09/28/2021, 11:13 AMwhite-airport-8778
freezing-spoon-15505
09/29/2021, 1:42 PMinfracost diff --path=/my/path/to/terragrunt/files
but I get
Detected Terraform directory at .
✖ Running terraform plan
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.
Error: Error running terraform plan: exit status 1
This is probably because I have a weird structure
├── app-1
│ ├── aws-data
│ │ ├── <http://data.tf|data.tf>
│ │ └── terragrunt.hcl
│ ├── ec2-app
│ │ └── terragrunt.hcl
│ ├── iam-app-user
│ │ └── terragrunt.hcl
│ ├── iam-instance-profile
│ │ └── terragrunt.hcl
│ ├── iam-instance-profile-policy
│ │ └── terragrunt.hcl
│ ├── postgres-rds
│ │ └── terragrunt.hcl
├── ec2-prometheus
│ └── terragrunt.hcl
├── app-3
│ ├── iam-user
│ │ └── terragrunt.hcl
│ └── s3
│ └── terragrunt.hcl
If I use infracost diff --path=./app-1
for example, then Infracost will use Terragrunt instead of Terraform and it will run successfully, however since it will execute run-all
commands it will take a lot of time to finish which is a problem especially for the CI.
Is there a workaround for this?
Please let me know if I am missing something or if it is better to open a GH Issue for my case.straight-address-35891
10/01/2021, 9:03 AMrefined-glass-2474
10/06/2021, 5:35 PMYou no longer need to specify multiple Terragrunt modules in your Infracost config file, unless you want to specify per-project usage. Infracost will now detect all the Terragrunt modules that exist under the specified --path
faint-mouse-18716
10/08/2021, 3:18 AMwhite-airport-8778
infracost/cloud-pricing-api:latest
to infracost/cloud-pricing-api:test
and retry? That docker image was built with https://github.com/infracost/cloud-pricing-api/pull/104 to see if that helps your setup as I can’t reproduce that issue on my local machine.numerous-plastic-31859
10/12/2021, 1:19 PMRun infracost/infracost-gh-action@master
/usr/bin/docker run --name infracostinfracostlatest_bf72ae --label fa4e14 --workdir /github/workspace --rm -e AWS_DEFAULT_REGION -e TERRAFORM_CLI_PATH -e INFRACOST_API_KEY -e GITHUB_TOKEN -e INPUT_PATH -e INPUT_TERRAFORM_PLAN_FLAGS -e INPUT_TERRAFORM_WORKSPACE -e INPUT_USAGE_FILE -e INPUT_CONFIG_FILE -e INPUT_PERCENTAGE_THRESHOLD -e INPUT_POST_CONDITION -e INPUT_SHOW_SKIPPED -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true --entrypoint "/scripts/ci/diff.sh" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/terraform/terraform":"/github/workspace" infracost/infracost:latest "plan.json" "" "" "" "" "" "{\"has_diff\": true}" ""
Running infracost breakdown using:
$ infracost breakdown --no-color --format json --path plan.json
Error: Could not detect path type for plan.json
Use the --path flag to specify the path to one of the following:
- Terraform plan JSON file
- Terraform/Terragrunt directory
- Terraform plan file
- Terraform state JSON file
Here are the relevant lines from our action file
- name: Terraform Plan
if: github.ref != 'refs/heads/master'
id: tfplan
run: terraform plan -input=false -out plan.tfplan
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Terraform show
if: github.ref != 'refs/heads/master' && steps.tfplan.outcome == 'success'
id: show
run: terraform show -json plan.tfplan > plan.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Run infracost diff
if: github.ref != 'refs/heads/master' && steps.tfplan.outcome == 'success'
uses: infracost/infracost-gh-action@master
env:
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: plan.json
Any clues? Let me know if you need more info 🙂astonishing-oil-57884
10/18/2021, 6:51 AMfast-oil-81957
10/22/2021, 11:38 AMfancy-waitress-35577
10/25/2021, 1:08 PM└─ Synced 0 of 6 resources
I guess it could be worked around with grep -v in the script but that seems like a hack so wanted to check did somebody else run into this or is this something you’re aware off.worried-librarian-67499
10/29/2021, 9:19 AMplain-ocean-92335
11/03/2021, 2:31 PMwhite-airport-8778
dry-airplane-95831
11/08/2021, 3:43 PMcold-author-37994
11/10/2021, 5:39 PMhallowed-fall-52170
11/12/2021, 12:08 AMbroad-rain-72019
11/19/2021, 5:53 PMquiet-planet-90619
11/22/2021, 8:28 PMwide-dawn-16734
11/23/2021, 1:07 PMbrief-agency-83899
11/24/2021, 10:52 AMlittle-author-61621
Error: Invalid API key
error when running Infracost, it's related to the current AWS issue.astonishing-oil-57884
11/26/2021, 10:02 AM