Hello! I am using the open source infracost CLI to...
# help
r
Hello! I am using the open source infracost CLI to estimate my AWS costs with resources defined with Terraform. I have a monorepo with two Terraform projects, and I have a simple usage file to defined the expected usage of my serverless resources, but I can't seem to find a way to add a project filter. I need this due to the fact we unfortunately have resources with the same name in the two Terraform projects. What I'd like to have is to specify the project an usage block refers to for a particular Terraform resource. Is it possible? I haven't found any info on the docs (other than it being possible on Infracost Cloud) or on GitHub. Thank you in advance!
s
Hi Francesco! If the resources have the exact same tf path name, then I don’t think so. But brainstorming one option might be to run breakdown twice, and use two config files and two usage files to target them separately. Would that work?
r
I was thinking about that too, but I'm using a CI action to post the breakdown in a PR as a comment, and I wanted to avoid having two comments. It's not a huge issue though, I guess I can just rename the resource. Thanks anyway!