When cost estimation is enabled on a Terraform Enterprise instance that is hosted on GCP, there is a chance you may get the following error when attempting to use cost estimation on your workspace.
panic: could not create Instance resolver: googleapi: Error 403:
Cloud Billing API has not been used in project XXXXXXXXXXX
before or it is disabled. Enable it by visiting
then retry. If you enabled this API recently, wait a few minutes
for the action to propagate to our systems and retry.
- The first time you use a new GCP project with Terraform Enterprise, the required Cloud Billing API needs to be enabled to successfully perform cost estimations.
- Enable the API for the affected project by visiting https://console.developers.google.com/apis/api/cloudbilling.googleapis.com
If after enabling the Cloud Billing API and waiting for a few minutes for the enablement to propagate through the GCP API system and subsequent Plans or Applies are still erroring out, please open a ticket with Hashicorp Support.