https://infracost.io logo
#help
Title
# help
m

mammoth-camera-93119

08/14/2023, 2:52 PM
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

little-author-61621

08/14/2023, 2:57 PM
Hi @mammoth-camera-93119, yeah the GitHub App should be able to detect this. What is the error you are seeing?
m

mammoth-camera-93119

08/14/2023, 2:59 PM
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

little-author-61621

08/14/2023, 3:02 PM
Ok thanks, let me look into it. I’m in a call just now but will hop on it right after.
m

mammoth-camera-93119

08/14/2023, 3:03 PM
thats what i get now, when indeed that terragrunt repo did create a change the infra
thank you!
l

little-author-61621

08/14/2023, 4:33 PM
@mammoth-camera-93119 can you paste/DM me the config file you are using just now?
m

mammoth-camera-93119

08/14/2023, 4:34 PM
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

little-author-61621

08/14/2023, 4:39 PM
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

mammoth-camera-93119

08/14/2023, 4:39 PM
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

little-author-61621

08/14/2023, 4:43 PM
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

mammoth-camera-93119

08/14/2023, 4:44 PM
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

little-author-61621

08/14/2023, 4:47 PM
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

mammoth-camera-93119

08/14/2023, 4:50 PM
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

little-author-61621

08/14/2023, 4:51 PM
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

mammoth-camera-93119

08/14/2023, 4:51 PM
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

little-author-61621

08/14/2023, 5:14 PM
Yeah, they are still running.
m

mammoth-camera-93119

08/14/2023, 5:15 PM
awesome ty, updated it with what should be the right ssh key before re-running
l

little-author-61621

08/14/2023, 5:18 PM
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

mammoth-camera-93119

08/14/2023, 5:19 PM
Okay tysm!
l

little-author-61621

08/14/2023, 6:05 PM
@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

mammoth-camera-93119

08/14/2023, 6:06 PM
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

little-author-61621

08/14/2023, 6:08 PM
Awesome, let me set up a private channel for us.
m

mammoth-camera-93119

08/14/2023, 6:08 PM
Paper.co is who i work for/represent
3 Views