This article describes the steps required to connect your GCP (Google Cloud Platform).
- Create a Billing report (as described here: https://cloud.google.com/billing/docs/how-to/export-data-bigquery-setup).
Note that the Billing table could be one of the following :
gcp_billing_export_resource_v1_<BILLING_ACCOUNT_ID> (preferred option with resource table enablement) -OR-
gcp_billing_export_v1_<BILLING_ACCOUNT_ID> (might result with missing usage info but consume less size so less expensive)
Note to use the exact naming convention for the billing table name, we will need this at a later stage during the account connection process.
2. Enable the Recommender API + Cloud Resource Manager API
3. Create a Role and Key, as per the following steps:
- Create a Role with the following permissions:
-
-
Specific permission bigquery.jobs.create permission (for creating jobs to run queries)
-
Compute Viewer
-
Monitoring Viewer
-
Compute Recommender Viewer
-
-
Fill in the Title and ID fields and then click ADD PERMISSIONS.
-
Add permissions according to the list above. Note that you should go through all of the pages and add all permissions.
** Keep in mind that you will have to mark it per page
-
- Add the Big Query Data Viewer to the dataset, as described in the following steps:
- Navigate to the BigQuery service and find the dataset you created in the billing export (step 1), and open it:
- Click SHARE DATASET.
- In the Dataset Permissions tab, under members, search for the service account you created in the previous step:
- Select the BigQuery Data Viewer role, click Add, and then Done.
- Navigate to the BigQuery service and find the dataset you created in the billing export (step 1), and open it:
- Navigate on the Anodot Cost platform to the Cloud Accounts tab under the Account menu (accessed from your profile avatar, in the top right corner):
- (Optional) Connect an additional project. Note that connecting an additional project enables Anodot Cost to analyze multiple projects in one single authorized service account.
- Navigate to IAM & Admin > Service accounts in the project you created the service account in initially and make a note of the email address, as it will be needed later on.
- Go to the destination project, i.e. the one that you want to add in the service account, and navigate to IAM & Admin > IAM. Then click ADD.
- Set the email you noted above and grant the the required roles (i.e. Compute Viewer, Monitoring Viewer, Compute Recommender Viewer, etc.). You can use the Currently used quick filter to find the required roles.
- Click Save to save the changes.
- Navigate to IAM & Admin > Service accounts in the project you created the service account in initially and make a note of the email address, as it will be needed later on.