Problem
When using the AzureRM provider, cost estimation in Terraform Enterprise returns the message "No estimable resources found".
Prerequisites
- You are using Terraform Enterprise.
- Cost Estimation Integration is enabled in Terraform Enterprise Admin settings.
- Cost Estimation is enabled at the Organization level.
Cause
This issue can occur for one of two reasons:
- The AzureRM resources in your configuration are not currently supported by the Cost Estimation feature.
- The Cost Estimation integration has encountered an internal error or bug.
Solutions
To diagnose the issue, you can query the Terraform Enterprise API to get more detailed information about the cost estimation process for a specific run.
Solution 1: Query the Runs API for Detailed Status
You can inspect the cost estimate object for a specific run by using the Runs API.
-
Export the required environment variables in your terminal. Replace the placeholder values with your information.
## Export the required environment variables. $ export TOKEN="YOUR_VALID_TOKEN" $ export TFE_HOSTNAME="REPLACE_WITH_TFE_FQDN" $ export RUN_ID="RUN_TO_INSPECT"
-
Execute the following
curlcommand to query the API. The output is piped tojqfor readability.## Query the API for the specified run ID. $ curl \ --header "Authorization: bearer $TOKEN" \ https://$TFE_HOSTNAME/api/v2/runs/$RUN_ID?include=cost_estimate | jq '.included'
Solution 2: Analyze the API Response
The API response will include a cost-estimates object with a status attribute. The value of this attribute determines the next steps.
Case 1: Status is errored
If the status is errored, the error-message attribute provides details that may indicate an issue with the Cost Estimation service. For guidance on how to proceed, refer to the Terraform Enterprise support documentation.
Example of an errored status with a panic message:
[
{
"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\n...",
"status": "errored"
}
}
]Case 2: Status is finished
If the status is finished, it means the cost estimation process completed successfully but did not find any resources it could estimate. Check the unmatched resources list in the API response and compare it to the list of supported Azure resources for Cost Estimation. If your resources are not on the supported list, this is the expected behavior.
Outcome
After querying the API, you can determine whether the failure is caused by unsupported resources in your configuration or a potential bug in the Cost Estimation service.