This message was deleted.
# general
b
This message was deleted.
a
Here's Spacelift status check showing infracost summary, which indicates Infracost is running to me
I've also set
Copy code
INFRACOST_CLI_ARGS="--project-name lsk-kafka-ec2-prod"
(or as appropriate based on the stack's slug), if that matters
The Spacelift log out looks like this. Most is unrelated to Infracost, but you can see Spacelift thinks Infracost ran fine:
Copy code
Saved the plan to: spacelift.plan

To perform exactly these actions, run the following command to apply:
    terraform apply "spacelift.plan"
[01G7YNKN4332YBVHC0MER7EMZQ] Changes are GO
[01G7YNKN4332YBVHC0MER7EMZQ] Uploading the list of managed resources...
[01G7YNKN4332YBVHC0MER7EMZQ] Generating Infracost JSON report from plan

[01G7YNKN4332YBVHC0MER7EMZQ] Infracost report generated successfully
[01G7YNKN4332YBVHC0MER7EMZQ] Mapping Infracost data to Terraform resources
[01G7YNKN4332YBVHC0MER7EMZQ] Costs mapped successfully
[01G7YNKN4332YBVHC0MER7EMZQ] Please be aware that Run changes calculation includes Terraform output changes.
[01G7YNKN4332YBVHC0MER7EMZQ] Resource list upload is GO
[01G7YNKN4332YBVHC0MER7EMZQ] Generating JSON representation of the plan...
[01G7YNKN4332YBVHC0MER7EMZQ] JSON representation is GO
[01G7YNKN4332YBVHC0MER7EMZQ] Generating Infracost JSON report from plan

[01G7YNKN4332YBVHC0MER7EMZQ] Infracost report generated successfully
[01G7YNKN4332YBVHC0MER7EMZQ] Evaluated 1 plan policy
[01G7YNKN4332YBVHC0MER7EMZQ] Plan policy warning: monthly cost increase greater than $50 ($1464.92)
[01G7YNKN4332YBVHC0MER7EMZQ] Plan policy warning: monthly cost increase greater than 5% (20.35%)
[01G7YNKN4332YBVHC0MER7EMZQ] Plan checks are GO
Initializing00:0615 minutes ago
Preparing00:0415 minutes ago
(the monthly cost warnings are custom code by us using infracost's JSON data)
b
Hello! đź‘‹ The Infracost Cloud functionality is mostly focused on VCS systems and CI/CD pipelines where users have control how Infracost CLI is run. Unfortunately, it looks like the ability to customize Infracost settings are pretty limited in Spacelift. You could try setting
INFRACOST_ENABLE_CLOUD=true
env var and make another run. Although there is not much info in their docs, the env var may be propagated to the CLI run.
w
@abundant-king-51389 the tick box to monitor cost estimates in Infracost Cloud’s Org Settings page currently only instructs the CLI to send its JSON output from
infracost comment
, which Spacelift doesn’t use. We’re changing that in the next two weeks so when you tick that box
infracost breakdown/diff/comment/output
are sent, meaning even if you use Spacelift you’ll be able to see the cost estimates in Infracost Cloud. Until then, please set the
INFRACOST_ENABLE_CLOUD=true
as Vadim mentioned that does the same thing. BTW, for github/gitlab, the Infracost CLI detects pull request data (e.g. PR URL, author) and shows them in Infracost Cloud but in Spacelift it can’t do that, so would it be helpful to have those as infracost env vars/flags so you can define them in the same way you do with project-name?
a
Thanks. I can configure INFRACOST_CLI_ARGS to set arbitrary additional arguments and all env vars will be passed to Infracost. It sounds easiest like I should set the infracost_enable_cloud env var. But if there is a command line arg I can use instead, that would be preferable from a clarity PoV.
w
@abundant-king-51389 yep the env var is the only option just now. That’s good feedback, I created this issue so we look into supporting all envs as flags - feel free to subscribe to it for updates.
🙌 1