New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable running infracost against a terraform.tfstate file #90
Comments
Bump for that issue - I'm using TerraGrunt and split my infra in a lot of modules and the work around needed are quite painful. Using the tfstate would really help. |
Since separating the infrastructure in several tfstates is a best practice in Terraform, it could be nice to process a set of tfstates instead of just one. Also reading them from cloud object storages like a S3 bucket. |
#203 adds a So in master you can run it with
This still needs the From my testing, this is a lot faster than running Let me know if this helps. |
I've created a new related issue here: |
@ctrlaltdev / @enribd can you possibly try v0.7.2 (available on brew too), and see if the Regarding several tfstates, maybe we can discuss it in #188 as it seems somewhat related. |
@alikhajeh1 It works fine! Regarding terragrunt, I'll open an issue for that. |
@ctrlaltdev thanks for creating #224, given the interest in that, I've put it at the top of the todo pile in https://github.com/infracost/infracost/projects/2 Closing this issue, new issues can be created for leftovers. |
To get costs of an existing infrastructure setup, we need to run something like:
So infracost does a terraform plan internally, and then uses the output of that to generate a report. Alternatively, we can do the
terraform plan
manually, and then supply the output to infracost.Either way is quite slow.
All of the information required to report on existing infrastructure will be in the
terraform.tfstate
JSON file for the project, so if it were possible to run something like:This could enable cost reports to be generated much more quickly - I'd guess a few seconds rather than several minutes, since it shouldn't be necessary to run
terraform init
beforehand either.For many use-cases, this may not be an issue, but in my particular case, with 200+ terraform projects to analyse, it makes a big difference, and I imagine some others will be in a similar situation.
The text was updated successfully, but these errors were encountered: