Difference between revisions of "Infracost"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
We run a free Cloud Pricing API, to get an API key run [[infracost auth login]] | We run a free Cloud Pricing API, to get an API key run [[infracost auth login]] | ||
− | + | == Example == | |
[[infracost breakdown --path]] ./ | [[infracost breakdown --path]] ./ | ||
− | + | ||
− | Detected Terragrunt directory at ./ | + | Detected Terragrunt directory at ./ |
✔ Downloading Terraform modules | ✔ Downloading Terraform modules | ||
✔ Evaluating Terraform directory | ✔ Evaluating Terraform directory | ||
✔ Retrieving cloud prices to calculate costs | ✔ Retrieving cloud prices to calculate costs | ||
− | + | ||
− | Project: Your-project/your-repo/your-terraform/code | + | Project: Your-project/your-repo/your-terraform/code |
− | + | ||
Name Monthly Qty Unit Monthly Cost | Name Monthly Qty Unit Monthly Cost | ||
− | + | ||
aws_instance.your_server | aws_instance.your_server | ||
├─ Instance usage (Linux/UNIX, on-demand, [[t3.medium]]) 730 hours | ├─ Instance usage (Linux/UNIX, on-demand, [[t3.medium]]) 730 hours | ||
Line 30: | Line 30: | ||
└─ Storage (general purpose SSD, gp3) 64 GB | └─ Storage (general purpose SSD, gp3) 64 GB | ||
$5.12 | $5.12 | ||
− | + | ||
OVERALL TOTAL | OVERALL TOTAL | ||
$35.49 | $35.49 |
Revision as of 12:57, 3 April 2023
brew install infracost infracost --help
infracost breakdown --path /code --terraform-var-file my.tfvars
infracost breakdown --path ./ Error: No INFRACOST_API_KEY environment variable is set. We run a free Cloud Pricing API, to get an API key run infracost auth login
Example
infracost breakdown --path ./ Detected Terragrunt directory at ./ ✔ Downloading Terraform modules ✔ Evaluating Terraform directory ✔ Retrieving cloud prices to calculate costs Project: Your-project/your-repo/your-terraform/code Name Monthly Qty Unit Monthly Cost aws_instance.your_server ├─ Instance usage (Linux/UNIX, on-demand, t3.medium) 730 hours $30.37 └─ root_block_device └─ Storage (general purpose SSD, gp3) 64 GB $5.12 OVERALL TOTAL $35.49 ────────────────────────────────── 19 cloud resources were detected: ∙ 1 was estimated, it includes usage-based costs, see https://infracost.io/usage-file ∙ 18 were free, rerun with --show-skipped to see details
See also
Advertising: