This message was deleted.
# general
b
This message was deleted.
f
I’ve started receiving the following error, despite nothing changing with my invocation.
Copy code
Error: --config-file flag cannot be used with the following flags or equivalent environment variables: --path, --terraform-*, --usage-file
My Azure pipeline script hews quite closely to the example:
The full error output from a failed run looks like this:
A couple final notes: • The
Running infracost breakdown using:
line shows what looks like a normal invocation that does not specify any of the reported conflicting flags. • I’m able to run
infracost breakdown --no-color --format json --config-file terraform/infracost.yml
(the reported invocation from the error message) on a local machine just fine, this only breaks in the Azure Pipeline • The directory structure looks roughly like this, with the workspace paths properly specified in infracost.yml
Copy code
|- repo/
  |- <other dirs>
  |- terraform/
    |- workspaces/
      |- a/
      |- b/
      |- <more workspaces>
    |- infracost.yml
Sorry for the massive post! I’d appreciate any insight anyone can provide
l
@faint-mouse-18716 thanks for all the details. This looks like a regression in the latest release. Will look at getting a fix out today. A workaround at the moment would be removing the
INFRACOST_TERRAFORM_CLOUD_TOKEN
env var and updating your config YAML to be something like:
Copy code
version: 0.1
projects:
  - path: path/to/code
    terraform_cloud_token: $TF_CLOUD_API_KEY
Then adding these lines to the bash step of the pipeline:
Copy code
envsubst < terraform/infracost.yml > terraform/infracost-updated.yml
mv terraform/infracost-updated.yml terraform/infracost.yml
@faint-mouse-18716 update on this: We've released a new version with a fix for this, so the above workaround shouldn't be needed. Can you let us know if this fixes the issue for you?
f
Thanks so much, Alistair! Will give this a shot today
🙌 1
Everything looks great on my side now! Thanks for the quick turnaround
🚀 1
l
Great 🙌! Thanks for the detailed descriptions, that helped track it down super quickly.