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

stale-needle-387

03/22/2024, 10:53 AM
Does the (free) Infracost GitHub app support Terragrunt? If it does, what do we need to do to enable it? I've just setup the GitHub app in our organization, but a test PR doesn't trigger Infracost > This check concluded as success. A pull request comment was not posted because your configurations are set to "Only post a comment in pull requests that have Terraform changes"
The change I made was in a file in the
_envcommon
directory.
Copy code
version: 0.1

projects:
  - path: ./development
    name: development
  - path: ./testing
    name: testing
  - path: ./production
    name: production
  - path: ./security
    name: security
  - path: ./logs
    name: logs
  - path: ./shared
    name: shared

dependency_paths:
  - "_envcommon/**"
Directory structure:
Copy code
tree -d shared
shared
├── eu-west-1
│   ├── mgmt
│   │   ├── ecs-deploy-runner
│   │   └── networking
│   │       ├── route53-resolver-query-logs
│   │       ├── vpc
│   │       └── vpc-flow-logs-central
│   └── _regional
│       ├── amis
│       ├── container_images
│       ├── ecr-repos
│       ├── monitoring
│       │   ├── cross-account-data-sharing
│       │   └── tag-compliance
│       ├── security
│       │   └── inspector
│       ├── service-quotas
│       └── shared-secret-resource-policies
l

little-author-61621

03/22/2024, 11:03 AM
@stale-needle-387, Terragrunt should work out the box. If you’re using
dependency_paths
it needs to be specified for each project, e.g:
Copy code
version: 0.1

projects:
  - path: ./development
    name: development
    dependency_paths:
      - "_envcommon/**"
  - path: ./testing
    name: testing
    dependency_paths:
      - "_envcommon/**"
  - path: ./production
    name: production
    dependency_paths:
      - "_envcommon/**"
  - path: ./security
    name: security
    dependency_paths:
      - "_envcommon/**"
  - path: ./logs
    name: logs
    dependency_paths:
      - "_envcommon/**"
  - path: ./shared
    name: shared
    dependency_paths:
      - "_envcommon/**"
s

stale-needle-387

03/22/2024, 11:07 AM
It's certainly taking longer after that change! Will get back to you if it worked. Thanks!
Is there any way for Infracost to use the include blocks inside each Terragrunt project to work out the dependencies, rather than needing them to all be defined in the
infracost.yml
? Maybe using
terragrunt --terragrunt-modules-that-include
flags behind the scenes? The report took quite long to run (20 minutes) with the above config file. Or will subsequent runs be faster?
l

little-author-61621

03/22/2024, 11:47 AM
@stale-needle-387 that’s a really good idea, but not something we do at the moment. If you DM me you organization ID and the full tree I can have a look at if there’s a way to speed it up. For Infracost Cloud subsequent runs are faster because we can cache results, but we’re not able to do this on Infracost CI/CD.
3 Views