How to add GCP cloud account
The process of adding an account consists of configuration steps on the client’s GCP account and proper configuration in the Cloudmizer application
- Prerequisites
- Adding an account in Cloudmizer
Prerequisites
As part of the prerequisites, we will save some data that will be useful in the next step.
You will perform the next steps in your AWS cloud account. Log in to it: https://console.cloud.google.com/
Setting up billing export to BigQuery
Start the process by going to the Billing service , then go to the billing linked to the project. The next step is to select Billing export and Edit Settings at Standard usage cost.
After reloading the page, click on Dataset and then Create New Dataset.
In the displayed form, select a name for the export and a location, and confirm the creation process.
The created item will appear on the list, which we select and save.
Creating a Role, Activating the API, Creating a service account and assigning an account to a role
The next step is to launch the shell with the icon on the top bar.and pasting the script provided below and executing it. The script automatically creates the necessary permissions and accounts.
PROJECT=$(gcloud config get-value project)
gcloud config set project ${PROJECT}
gcloud iam roles create CloudmizerRole –project=${PROJECT} –title=CloudmizerRole –description=CloudmizerRole –permissions=bigquery.datasets.get,bigquery.jobs.create,bigquery.tables.get,bigquery.tables.getData,bigquery.tables.list,compute.machineTypes.list,resourcemanager.projects.get,compute.machineTypes.get,compute.reservations.get,compute.reservations.list,compute.zones.list,compute.instances.list,compute.commitments.list –stage=GA
gcloud services enable cloudbilling.googleapis.com
gcloud services enable cloudresourcemanager.googleapis.com
gcloud services enable compute.googleapis.com
gcloud iam service-accounts create Cloudmizeraccount
gcloud projects add-iam-policy-binding ${PROJECT} –member “serviceAccount:Cloudmizeraccount@${PROJECT}.iam.gserviceaccount.com” –role “projects/${PROJECT}/roles/CloudmizerRole”
After the script is finished, go to IAM & Admin and Service Accounts.
Select the created account by selecting its name.
Then go to the KEYS tab and select the ADD KEY button and the Create new key option.
Select the JSON type and confirm the form. This will download a file that will be required in the process of adding an account in the application.
Generating an API key
The last preparatory step is to go to APIs & Services and Credentials.
After reloading the page, go through Create Credentials and API key.
A key will be generated, which should be saved for later use.
Adding a cloud account in Cloudmizer
After logging in to the Cloudmizer app, go to
After clicking the +Add account button, a form will be displayed in which you should select GCP as Provider and give a unique name to the new account. Then we confirm the willingness to add an account by checking “I want to connect Cloudmizer with my cloud account”.
In the next field, paste the previously prepared API Key value. Then we can enter the percentage of discounts we have (Fixed discount) and determine what type of commitment sharing options you use. We have the option to choose:
- NO_SHARING – commitment is not shared,
- BILLING_ACCOUNT_SCOPE – commitment is shared across the whole billing,
- PROJECT_SCOPE – commitment is shared across single project.
The next step is to add files – keys. We add them by pressing the paperclip icon and selecting them from the computer’s hard drive. Confirm by selecting the option that biling export is enabled and that the necessary API is enabled.
The whole thing ends with the SIGN button. After successfully adding your account, the data download process will begin, which may take up to 24 hours.