docs/documentation/platform/pam/accounts/gcp-service-account.mdx
GCP Service Accounts let you broker credential-less access to Google Cloud. Instead of handing out long-lived service account keys, users request access through Infisical and connect to Google Cloud as the target service account through a Gateway, with every access logged.
<Note> GCP Service Accounts are available through the **CLI and API only** — there is no in-browser (web) access. </Note>Each account points at a single GCP service account (identified by its email). When a user starts a session:
googleapis.com on their behalf.You pick one of these when creating the account. The setup for each is covered in the steps below.
The template (or the account) must be assigned a [Gateway](/documentation/platform/gateways/overview) — GCP traffic is proxied through it, so the Gateway needs outbound access to `googleapis.com` on port `443`.
<Tabs>
<Tab title="Impersonation">
There are no credentials to enter — but you need a one-time setup so Infisical can impersonate your target service account.
**1. Enable the IAM Service Account Credentials API**
In the target service account's Google Cloud project, enable the IAM Service Account Credentials API (`iamcredentials.googleapis.com`). Without it, the account still saves, but sessions fail with a token-generation error when you try to connect.
**2. Find Infisical's service account**
| Environment | Infisical's service account |
|-------------|-----------------------------|
| Infisical Cloud US | `[email protected]` |
| Infisical Cloud EU | `[email protected]` |
| Self-hosted | The service account configured via the `INF_APP_CONNECTION_GCP_SERVICE_ACCOUNT_CREDENTIAL` environment variable |
**3. Grant it the Token Creator role**
In the Google Cloud Console, go to **IAM & Admin → Service Accounts**, select your **target** service account, open the **PERMISSIONS** tab, click **Grant Access**, add Infisical's service account (from step 2) as a principal, and assign it the **Service Account Token Creator** (`roles/iam.serviceAccountTokenCreator`) role.
<Note>
**Self-hosted only:** impersonation first needs a platform GCP service account configured on your instance — a one-time setup covered in [Configuring GCP for a self-hosted instance](/integrations/app-connections/gcp).
</Note>
</Tab>
<Tab title="Static Key">
Provide a service account key JSON. Infisical stores it encrypted and never returns it to clients.
**1. Create a key**
In the Google Cloud Console, go to **IAM & Admin → Service Accounts** and select the service account to use — either the target service account itself, or a privileged one allowed to impersonate it. Open the **KEYS** tab, click **Add Key → Create new key**, and choose **JSON**. The file downloads automatically.
**2. Paste it into the form**
| Field | Description |
|-------|-------------|
| **Service Account Key JSON** | The full contents of the downloaded JSON key (must contain `client_email` and `private_key`) |
</Tab>
</Tabs>
Use the CLI to start a session. This requires the gcloud CLI to be installed locally.
infisical pam access my-folder/prod-deployer
The command automatically configures gcloud for the session — you don't need to change anything or run any extra commands. Once it's active, use gcloud (and other Google Cloud tooling) as normal:
gcloud compute instances list
gcloud storage ls
Press Ctrl+C to stop the session (or wait for it to expire). Your gcloud configuration is automatically restored when the session ends.
Flags:
--reason <reason> — provide an access reason (if required by the template)--duration <duration> — request a session duration (e.g., 30m), capped at the template maximum