Difference between revisions of "Infracost"

From wikieduonline
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
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 ==
+
== Examples ==
 +
 
 +
=== [[t3.medium]] server ===
 
  [[infracost breakdown --path]] ./
 
  [[infracost breakdown --path]] ./
 
   
 
   
Line 25: Line 27:
 
   
 
   
 
  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         
 
  $30.37
 
  $30.37
 
  └─ root_block_device
 
  └─ root_block_device
Line 38: Line 40:
 
  ∙ 18 were free, rerun with [[--show-skipped]] to see details
 
  ∙ 18 were free, rerun with [[--show-skipped]] to see details
  
 +
=== [[ECS service]] + [[Cloudwatch log group]] ===
 +
.../...
 +
[[aws_cloudwatch_log_group]].your_service
 +
├─ Data ingested                        Monthly cost depends on usage: $0.50 per GB
 +
├─ Archival Storage                      Monthly cost depends on usage: $0.03 per GB
 +
└─ Insights queries data scanned        Monthly cost depends on usage: $0.005 per GB
 +
 +
aws_ecs_service.your_service
 +
├─ Per GB per hour                                    4  GB                      $12.98
 +
└─ Per [[vCPU]] per hour                                  2  CPU                    $59.10
 +
 +
OVERALL TOTAL                                                                    $72.08
 +
 +
== Related ==
 +
* [[Terraform]]
 +
* [[pre-commit]]
 +
* [[vCPU]]
 +
* [[Terraform Cloud cost estimation]]
  
 
== See also ==
 
== See also ==
 
* {{Infracost}}
 
* {{Infracost}}
 +
* {{Cloud cost}}
 +
 +
[[Category:Terraform]]

Latest revision as of 14:43, 12 June 2024

wikipedia:Infracost

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

Examples[edit]

t3.medium server[edit]

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

ECS service + Cloudwatch log group[edit]

.../...
aws_cloudwatch_log_group.your_service
├─ Data ingested                         Monthly cost depends on usage: $0.50 per GB
├─ Archival Storage                      Monthly cost depends on usage: $0.03 per GB
└─ Insights queries data scanned         Monthly cost depends on usage: $0.005 per GB

aws_ecs_service.your_service
├─ Per GB per hour                                    4  GB                      $12.98
└─ Per vCPU per hour                                  2  CPU                     $59.10
OVERALL TOTAL                                                                    $72.08

Related[edit]

See also[edit]

Advertising: