Setting up a GCP Integration
Last updated
Was this helpful?
Last updated
Was this helpful?
At the moment, CloudQuery Platform only supports authentication with GCP through Service Accounts. This document explains the steps in this process.
Head to the Google Cloud Console and enable the Cloud Resource Manager API:
On the top, make sure you select the project you want to grant CloudQuery access to. Then, click Next.
Click Enable.
CloudQuery will use a Service Account to read resources from your GCP environment. Follow these steps to set up a new Service Account with read-only access:
Select the project to create the service account in (we can assign access to other projects later)
Click Create Service Account
Enter the details:
Service account display name, e.g. CloudQuery Readonly
Service account ID, e.g. cloudquery-readonly
A description to help you and others identify the purpose of this service account later, e.g. Service account for CloudQuery to fetch resources in GCP
Click Create and Continue
Under Basic, Select Viewer
role for the service account.
Click Continue and Done.
You should now see the new service account in the list. Click on it, and go to the Keys tab. Click Add Key → Create New Key
Select JSON and click Create. This will download a file to your computer. You will need this when setting up the integration later.
To sync resources across all our GCP projects, we can grant the required access to the service account we just created. Depending on your case, you may want do this on the organization-level, or on the folder level.
In the Console Project selection screen, select your top-level Organization (or folder)
Go to IAM and Admin / IAM, and click Grant Access
Paste the email address of the service account we created above in the New Principals textbox. Again, assign a Viewer role.
Click Save
Similar to the process for Organizations and folders described above, you can also follow the same steps to add individual projects for CloudQuery to sync, if desired. This is not required if you already followed the steps for organizations or folders above.
In the Console Project selection screen, select the relevant project
Go to IAM and Admin / IAM, and click Grant Access
Paste the email address of the service account we created above in the New Principals textbox. Again, assign a Viewer role.
Click Save
In CloudQuery Platform, go to Data Pipelines → Integrations. Click Create Integration and type GCP to find the GCP integration.
Choose a name for your integration (e.g. GCP).
Click the Upload JSON file or drag the credentials JSON file created in Step 2 in the designated space.
Click Continue
On the next page, select the services to sync. The services represent a group of tables the GCP integration can sync. For the full list of tables, see the GCP Plugin Documentation.
If you are looking for a particular table, use the search above the list of services. You can also expand individual services to select/unselect indivudual tables using this toggle button (visible when you move your mouse pointer over the service name):
Click the Test and Save to test the connection and save the integration.
With your GCP integration created, you can now proceed to use it in a new sync. This will give you the opportunity to specify when your GCP sync should be run, and to which destination databases.