Problem
AzureRM cost estimation returns "No estimable resources found" in Terraform Enterprise.
Prerequisites
- Terraform Enterprise
- Cost Estimation Integration is enabled in Terraform Enterprise Admin settings
- Cost Estimation is enabled at the Organization level
Cause
- The Azurerm resources referenced are not supported by Cost Estimation
- The Cost Estimation integration has encountered a bug
Solutions:
- Query the runs API to get additional information:
# Export the variables in your terminal before executing the curl command
export TOKEN=$YOUR_VALID_TOKEN
export TFE_HOSTNAME=https://$REPLACE_WITH_TFE_FQDN
export RUN_ID=$RUN_TO_INSPECT
# Pipe to jq included for readability but not required
curl \
--header "Authorization: bearer $TOKEN" \
https://$TFE_HOSTNAME/api/v2/runs/$RUN_ID?include=cost_estimate|jq '.included'
- If the
cost-estimates
status iserrored
gather the details and submit a support request, example:
"id": "ce-cGoqimyNs2Y8rczy",
"type": "cost-estimates",
"attributes": {
"error-message": "panic: didn't find any prices for PremiumContainer Plan | PC2 in EU West\n\ngoroutine 19 [running]:\ngithub.com/hashicorp/cost-estimation/internal/pkg/azure.(*ASPlan).Price(0xc0004337a0, 0xbf5cd0, 0x4, 0x0)\n\t/go/src/tfce/internal/pkg/azure/appservice.go:190 +0x857\ngithub.com/hashicorp/cost-estimation/internal/pkg/graph.(*Graph).Walk.func1(0x111bcd8, 0x0, 0x0, 0xc0005401f8, 0x1, 0x1)\n\t/go/src/tfce/internal/pkg/graph/graph.go:168 +0x2fb\ngithub.com/hashicorp/cost-estimation/internal/pkg/graph.(*Graph).Walk(0xc000433050, 0xc000db3d48)\n\t/go/src/tfce/internal/pkg/graph/graph.go:181 +0xf7\ngithub.com/hashicorp/cost-estimation/internal/pkg/estimator.(*Driver).buildMatchSet(0xc000505860, 0xc0004321e0, 0xd07d20, 0xc000e020c0, 0xc000e020c0)\n\t/go/src/tfce/internal/pkg/estimator/driver.go:43 +0x1db\ngithub.com/hashicorp/cost-estimation/internal/pkg/estimator.(*Driver).Do(0xc000505860, 0xcf7f00)\n\t/go/src/tfce/internal/pkg/estimator/driver.go:67 +0xcd\ngithub.com/hashicorp/cost-estimation/internal/app/tfce.(*Application).runEstimator(0xc0002a7040, 0xd004c0, 0xc0000a8000, 0x0, 0x0)\n\t/go/src/tfce/internal/app/tfce/tfce.go:174 +0x7db\ngithub.com/hashicorp/cost-estimation/internal/app/tfce.(*Application).Main.func2(0xc00041a000, 0xc0002a7040, 0xd004c0, 0xc0000a8000)\n\t/go/src/tfce/internal/app/tfce/tfce.go:107 +0x3f\ncreated by github.com/hashicorp/cost-estimation/internal/app/tfce.(*Application).Main\n\t/go/src/tfce/internal/app/tfce/tfce.go:106 +0x159\n",
"status": "errored",
- If the
cost-estimates
status isfinished
check the list ofunmatched
resources and compare them to the documented supported resources. If indeed the resources are unsupported, open a support request to add the feature.
Outcome
Determine if the failure is caused by a bug in the Cost Estimation integration or due to the resources not being supported before opening a support request.