A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/terraform/cloud-docs/cost-estimation below:

Cost estimation overview for HCP Terraform | Terraform

HCP Terraform provides cost estimates for many resources found in your Terraform configuration. For each resource an hourly and monthly cost is shown, along with the monthly delta. The total cost and delta of all estimable resources is also shown.

HCP Terraform disables cost estimation by default. To enable cost estimation:

  1. Sign in to HCP Terraform or Terraform Enterprise, then navigate to the organization where you want to enable cost estimation.
  2. Choose Settings from the sidebar, then Cost Estimation.
  3. Toggle the Enable cost estimation for all workspaces setting.
  4. Click Update settings.

When enabled, HCP Terraform performs a cost estimate for every run. Estimated costs appear in the run UI as an extra run phase, between the plan and apply.

The estimate displays a total monthly cost by default; you can expand the estimate to see an itemized list of resource costs, as well as the list of unestimated resources.

Note that this is just an estimate; some resources don't have cost information available or have unpredictable usage-based pricing. Supported resources are listed in this document's sub-pages.

You can use a Sentinel policy to validate your configuration's cost estimates using the tfrun import. The example policy below checks that the new cost delta is no more than $100. A new t3.nano instance should be well below that. A decimal import is available for more accurate math when working with currency numbers.

import "tfrun"
import "decimal"

delta_monthly_cost = decimal.new(tfrun.cost_estimate.delta_monthly_cost)

if delta_monthly_cost.greater_than(100) {
    print("This policy prevents a user from increasing their spending by more than $100 per month in a single run without a warning.")
}

main = rule {
    delta_monthly_cost.less_than_or_equals(100)
}

Cost estimation in HCP Terraform supports Terraform resources within three major cloud providers.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4