December 2021: Share Cost Estimates, Composable GitLab CI And New Resources

Summary: Infracost v0.9.16 is live! You can now share cost estimates with colleagues, managers and with your external clients. We have also released our new composable GitLab CI template, and 10 new AWS/Azure/Google resources. Upgrade now!

Share cost estimates

There are a few use cases in which sharing cost estimates with others is really helpful: sharing an estimate with a colleague so they can review the changes, with a manager to set expectations of a cost spike due to upcoming infrastructure changes, or for doing what-if analysis by creating multiple cost estimates with different options and sending them to internal or external clients.

I’m very excited to announce that you can now automatically create sharable links! Checkout this example

The Infracost dashboard is part of our hosted services and you can enable it by running:

# in CLI:
infracost configure set enable_dashboard true

# in CI/CD:

Once enabled, the Infracost CLI sends its JSON output to the dashboard so it can generate unique share links. The Infracost JSON output does not contain any cloud credentials or secrets. The link is also included in the Infracost JSON output so it can be parsed and used in your workflow, for example by sending it to Slack.

New Infracost Docker image

We’ve heard from users that you’d like to use the official Terraform/Terragrunt images alongside Infracost in any CI/CD system. For this use case, we’ve created new smaller Docker images without the multiple Terraform or Terragrunt binaries. The new images only include the Infracost CLI, Compost and helper bash scripts:

  • infracost/infracost:ci-0.9 (recommended) – Always use the latest 0.9.x version to pick up bug fixes and new resources.
  • infracost/infracost:ci-0.9.16 – Lock to v0.9.16.
  • infracost/infracost:ci-latest – Always use the latest Infracost image. This might break when new minor or major versions are released.

New composable GitLab CI template

As you deploy Infracost into all your CI/CD pipelines, you might need different commenting behaviors. For example, instead of leaving a comment every time something is changed in a merge request, leave a single cost estimate comment and keep updating it with the latest estimate. This is now possible with the new Infracost GitLab CI template, which provides a composable way of using Infracost in your workflow. The new template also enables you to use the latest backward compatible version of Infracost.

If you used the old Infracost template, please follow our migration guide. The old template is deprecated but will continue to work without issues.

New resources

We added support for 10 new resources this month:

  • AWS: aws_cloudtrail and the new Indonesia region (ap-southeast-3)
  • Azure: azurerm_sql_databaseazurerm_virtual_wanazurerm_virtual_hubazurerm_vpn_gatewayazurerm_point_to_site_vpn_gatewayazurerm_express_route_gatewayazurerm_vpn_gateway_connectionazurerm_express_route_connection
  • Google: google_artifact_registry_repository

Speed it up!

Using Infracost with a config-file now runs a lot faster as we process the projects in parallel 🚀


Terragrunt CLI flags can now be passed through the INFRACOST_TERRAGRUNT_FLAGS environment variable:

INFRACOST_TERRAGRUNT_FLAGS="--terragrunt-exclude-dir dev" infracost breakdown --path /path/to/terragrunt/code

We’ve also fixed an issue that was causing problems for tgenv users (used to handle multiple versions of Terragrunt), though we recommend using tgswitch as tgenv no longer seems to be maintained.

Community highlights

Shout-out to:

  • Our friends at Scalr who announced their native Infracost integration! Scalr enable companies to decentralize their Terraform operations.
  • Josh Niec who added a resource mapping.
  • Kanishk Agrawal who wrote a blog about Terraform pull request automation using Atlantis and Infracost.

Finally, Hugo, who was a regular contributor, has joined our team!

Jump in!

Up next, we’re focusing on composable Azure DevOps integration, more seamless integration with Atlantis and improving our JSON format. You keep sharing your feedback and we’ll keep shipping 🚀

Message me on Slack or Twitter if you have any questions!

Similar Posts