Hey - we’re just getting started with Infrascost t...
# help
a
Hey - we’re just getting started with Infrascost today, and have a question about the previous cost. Is there a way to dry-run the terraform code, so the tool knows what we have deployed already with terraform?
m
Hey @aloof-memory-96366, there’s a number of ways to achieve this, can I ask what your setup is: 1. How are you using Infracost? 2. How do you normally deploy your Terraform code? Does your main branch represent what is deployed 3. What is your VCS system
a
Using the cloud version, with github. The main branch does have what is deployed (split out into projects per environment)
m
so are you using the github app?
a
yeah
m
ok so a follow up question: have you opened a PR yet with the GH app enabled, or have you just run on the main branch?
a
yeah, I have done a PR (to add a new instance group to a GRP project)
m
ok great, so going back to your original question. I think I might be a bit confused. What would you like to achieve. As if i understand correctly - your main branch has the current deployed infrastructure, so opening a PR to it will show the previous cost of the “deployed” infrastructure. Am I missing something?
a
The previous cost of that project is about $150,000 a month
m
right - so this suggests that you have some configuration issues
most likely Infracost is assuming an incorrect project structure
a
ok
m
have you added a config file yet?
a
yeah (although it’s in the PR same PR, not on the main branch yet)
Copy code
version: 0.1
projects:
  - path: projects/dev-us
    terraform_workspace: infra-air-google-dev-us

  - path: projects/alpha-us
    terraform_workspace: infra-air-google-alpha-us

  - path: projects/uat-lcl-a
    terraform_workspace: infra-air-google-uat-lcl-a

  - path: projects/sandbox-uk
    terraform_workspace: infra-air-google-sandbox-uk

  - path: projects/production-uk
    terraform_workspace: infra-air-google-production-uk

  - path: projects/production-us
    terraform_workspace: infra-air-google-production-u2

  - path: projects/production-us2
    terraform_workspace: infra-air-google-production-us2

  - path: projects/production-au
    terraform_workspace: infra-air-google-production-au
m
ok cool - are you free to jump on a call, I might be able to help you out easier
a
Yes please, although I might need my colleague too (who maintains the TF repo). He’s around tomorrow if you’re free?
m
Ok sure if you DM me your email i’ll ping you an invite
a
thanks!
m
can you send me your organization_id as well as I might be able to look into something in the meantime