Infracost it’s a tool that works with terraform to calculate the costs of the infrastructure setup.


We need first to install Terraform with we don’t have it already:

brew install terraform

Then we can install Infracost:

brew install infracost

Then register it to get a free API key:

❯ infracost register
Please enter your name and email address to get an API key.
See our FAQ ( for more details.
Name: Albert

Thank you Albert!
Your API key is: -------------------

Success: Your API key has been saved to /Users/albert/.config/infracost/credentials.yml
You can now run infracost breakdown --path=... and point to your Terraform directory or JSON/plan file.


To check our current cost based on a Terraform project execute the following taking into account that we have our Terraform project in the current folder:

infracost breakdown --path .