> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Google Cloud Compute with Service Account – StackOne Hub

> Link a Google Cloud Compute account in the StackOne Hub using Service Account. End-user guide to authorize the integration and start using Google Cloud Compute actions.

> [!WARNING]
>
> You need permission to create service accounts, grant roles and create keys in the Google Cloud project, such as the Service Account Admin, Service Account Key Admin and Project IAM Admin roles.

## Creating a service account key

Work in the Google Cloud project you are connecting. The roles you grant the service account decide which actions work.

**1. Enable the required APIs**

Sign in to the [Google Cloud Console](https://console.cloud.google.com/) and select the project. Turn on the Compute Engine API, Cloud Run Admin API, Cloud Functions API and Artifact Registry API.

<ul>
  <li>For each API, search for it in **Search (/) for resources, docs, products, and more** and open it.</li>
  <li>Click **Enable**.</li>
  <li>If the page shows **Manage** and **API Enabled**, the API is already on.</li>
</ul>

![Compute Engine API product page with the Manage button and the API Enabled status highlighted.](https://mintcdn.com/stackone-60/0oEuuOuv7Dnajv38/connectors/googlecloudcompute/images/service-account-config-enable-api.png?fit=max\&auto=format\&n=0oEuuOuv7Dnajv38\&q=85\&s=a76723b3c2ba339e590f12ab1814d362)

**2. Create the service account**

Open **IAM & Admin** > **Service Accounts**.

<ul>
  <li>Click **Create service account**.</li>
  <li>**Service account name**: `StackOne Integration`</li>
  <li>Click **Create and continue**.</li>
</ul>

![Create service account form with the Service account name field and the Create and continue button highlighted.](https://mintcdn.com/stackone-60/0oEuuOuv7Dnajv38/connectors/googlecloudcompute/images/service-account-config-create-account.png?fit=max\&auto=format\&n=0oEuuOuv7Dnajv38\&q=85\&s=66ea60023dafaa640146717a74545a38)

**3. Grant the roles**

Under **Permissions (optional)**, add a role for each kind of action you plan to use.

<ul>
  <li>Click **Select a role**.</li>
  <li>Search for `Reader`.</li>
  <li>Select **Reader** for read-only access.</li>
  <li>To create, change or delete resources, click **Add another role** and add **Compute Admin**, **Cloud Run Admin**, **Cloud Functions Admin** or **Artifact Registry Administrator** for each service you manage.</li>
  <li>Add **Service Account User** as well to create or update Cloud Run services, Cloud Run jobs or functions, which always run as a service account, or VMs that have one attached.</li>
  <li>Click **Continue**.</li>
  <li>Click **Done**.</li>
  <li>New roles can take a few minutes to become active.</li>
</ul>

![Permissions step of the Create service account form with the Reader role and the Continue button highlighted.](https://mintcdn.com/stackone-60/0oEuuOuv7Dnajv38/connectors/googlecloudcompute/images/service-account-config-grant-role.png?fit=max\&auto=format\&n=0oEuuOuv7Dnajv38\&q=85\&s=e3b2c943d322e3bb6cee8e48b2f82d7b)

**4. Create the JSON key**

In **Service Accounts**, click the email of the new service account and open the **Keys** tab.

<ul>
  <li>Click **Add key**.</li>
  <li>Select **Create new key**.</li>
  <li>**Key type**: **JSON**</li>
  <li>Click **Create**. The key file downloads once, and Google can't recover it if it is lost.</li>
  <li>If your organization blocks key creation with an organization policy, ask an organization policy administrator to allow it for this project.</li>
</ul>

![Create private key dialog with the JSON key type and the Create button highlighted.](https://mintcdn.com/stackone-60/0oEuuOuv7Dnajv38/connectors/googlecloudcompute/images/service-account-config-create-key.png?fit=max\&auto=format\&n=0oEuuOuv7Dnajv38\&q=85\&s=a0b1be299e9ed455a2945b14b8d72ac4)

## Entering the key

Open the downloaded `.json` key file in a text editor.

<ul>
  <li>Copy the entire file across as the **Service Account Key (JSON)**.</li>
  <li>Copy the `project_id` value across as the **GCP Project ID**, or use the ID of another project the service account has roles on.</li>
</ul>

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/connect/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.