Coder Social home page Coder Social logo

Comments (7)

ayr-ton avatar ayr-ton commented on May 18, 2024 1

I've created a new related issue here:

https://gitlab.com/infracost/infracost-gitlab-ci/-/issues/1

from infracost.

ctrlaltdev avatar ctrlaltdev commented on May 18, 2024

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.

from infracost.

enribd avatar enribd commented on May 18, 2024

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.

from infracost.

aliscott avatar aliscott commented on May 18, 2024

#203 adds a --use-tfstate flag, which might solve this use case.

So in master you can run it with

# if running dev:
make run ARGS="--tfdir=/path/to/code --use-tfstate"

# if running binary:
infracost --tfdir=/path/to/code --use-tfstate

This still needs the terraform binary to run terraform show internally instead of directly reading the state file, which is the recommended way of interacting with the state (https://www.terraform.io/docs/state/index.html#format) and has the added benefit of working with both local and remote states.

From my testing, this is a lot faster than running terraform plan each time 😄

Let me know if this helps.

from infracost.

alikhajeh1 avatar alikhajeh1 commented on May 18, 2024

@ctrlaltdev / @enribd can you possibly try v0.7.2 (available on brew too), and see if the infracost --tfdir=/path/to/code --use-tfstate option is good enough to close this issue? It works with remote state. I haven't used TerraGrunt much so it would be great if you can create issues with any difficulties you hit with that.

Regarding several tfstates, maybe we can discuss it in #188 as it seems somewhat related.

from infracost.

ctrlaltdev avatar ctrlaltdev commented on May 18, 2024

@alikhajeh1 It works fine!
Just used on a couple of modules and I get a nice output back!

Regarding terragrunt, I'll open an issue for that.

from infracost.

alikhajeh1 avatar alikhajeh1 commented on May 18, 2024

@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.

from infracost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.