hey infracost! I’m not quite sure how to connect ...
# help
m
hey infracost! I’m not quite sure how to connect my Github App to my infracost cloud account as I’m using it for a Terragrunt project. I do indeed have project and a root level terragrunt.hcl that looks like it should be picking it up fine. I’ve followed all the steps and tried quite a few config files with no luck. anyone else gotten stuck here? I thought it would be able to auto detect the terragrunt.hcl files without any issue 🤷🏻‍♀️
this looks like it should work, but my files are terragrunt.hcl’s
l
Hi @mammoth-camera-93119, yeah the GitHub App should be able to detect this. What is the error you are seeing?
m
hey thanks for the quick response @little-author-61621! it was complaining that it couldn’t find files, but with that above config it doesn’t error lol. Just doesn’t spit out any cost estimates for me
l
Ok thanks, let me look into it. I’m in a call just now but will hop on it right after.
m
thats what i get now, when indeed that terragrunt repo did create a change the infra
thank you!
l
@mammoth-camera-93119 can you paste/DM me the config file you are using just now?
m
From the docs -
Copy code
version: 0.1

projects:
{{- range $project := matchPaths "envs/:env/terragrunt.hcl" }}
  - path: .
    name: {{ $project.env }}
    terraform_var_files:
      - {{ $project._path }}
{{- end }}
It kinda implies it should autodetect the root level terragrunt.hcl, and im sorta failing to find any other decent examples
Just wanting to run it on the main branch
Copy code
infra-terragrunt-envs
is the repo im trying to work with from my infracost cloud dashboard
l
Can you try the following?
Copy code
version: 0.1

projects:
{{- range $project := matchPaths "envs/:env(.*)/terragrunt.hcl" }}
  - path: {{ $project._dir }}
    name: {{ $project.env }}
{{- end }}
terraform_var_files
is for
.tfvar
files so I don’t think we need this.
path
should point to the directory that contains the Terragrunt project And I’ve change
:env
to
:env(.*)
so this can match on multiple depths of subfolders.
m
Ooh ok,one moment please
Re-estimating with new config, lets see what comes back
Yea i figured that was wrong, didnt know if there was uhh, some kinda automagic or something there 😅
l
Awesome, I’ll take a look separately at why the autodetecting isn’t picking up this case, but let’s get a config file working first.
m
definitely ty for the help as well sir! Circle for estimation is spinning - its a decently sized project, which is why if i had to guess
l
Do those
terragrunt.hcl
files load the source from a remote location? If so you might need to set up some credentials for them as per https://www.infracost.io/docs/integrations/github_app/#usage
(or maybe you’ve done this already)
Circle for estimation is spinning - its a decently sized project, which is why if i had to guess
Depending on the number of projects, the first run might be slower since we’ll be populating the cache.
m
Yeah i did, hmm that didn’t load any cost or report any errors with that config
Let me check a few things and get back to you if i need to, thank you so much @little-author-61621 i think I see what I need to fix now
Super helpful, appreciate it
l
I’m looking at our prod logs now and we are running some long running jobs for your org, so it might just be taking a while on this first run. I’ll ping you when those have completed.
m
ohhh got you
ok
sweet
Thought i already set the ssh up, gonna do that now. Looks like it might work if i do
re-running with proper ssh key now 😄
Anything running in those logs now @little-author-61621?
l
Yeah, they are still running.
m
awesome ty, updated it with what should be the right ssh key before re-running
l
Okay, it looks like there’s an issue on our end with generating for this repo. Let me take a look into it and I’ll message you when we have a cost estimate generated.
m
Okay tysm!
l
@mammoth-camera-93119 that’s the issue resolved and the cost estimate generated. I’m still seeing 16 of the projects failing, so the next step for me is to look into them to see why. I’ll give you an update about this tomorrow.
m
I see them generating now, thank you so much for the help. Very much appreciated. after this, i would love to get some pricing for my organization from you all as well
l
Awesome, let me set up a private channel for us.
m
Paper.co is who i work for/represent