docs/documentation/platform/dynamic-secrets/gcp-iam.mdx
The Infisical GCP IAM dynamic secret allows you to generate GCP service account tokens on demand based on service account permissions.
<Warning> GCP service account access tokens cannot be revoked. As such, revoking or regenerating a token does not invalidate the old one; it remains active until it expires. </Warning> <Note> You must enable the [IAM API](https://console.cloud.google.com/apis/library/iam.googleapis.com) and [IAM Credentials API](https://console.cloud.google.com/apis/library/iamcredentials.googleapis.com) in your GCP console as a prerequisite </Note> <Accordion title="Self-Hosted Instance"> Using the GCP integration on a self-hosted instance of Infisical requires configuring a service account on GCP and configuring your instance to use it.<Steps>
<Step title="Enable the IAM Service Account Credentials API">

</Step>
<Step title="Navigate to IAM & Admin > Service Accounts in Google Cloud Console">

</Step>
<Step title="Create a Service Account">
Create a new service account that will be used to impersonate other GCP service accounts for your app connections.

Press "DONE" after creating the service account.
</Step>
<Step title="Generate Service Account Key">
Download the JSON key file for your service account. This will be used to authenticate your instance with GCP.

</Step>
<Step title="Configure Your Instance">
1. Copy the entire contents of the downloaded JSON key file.
2. Set it as a string value for the `INF_APP_CONNECTION_GCP_SERVICE_ACCOUNT_CREDENTIAL` environment variable.
3. Restart your Infisical instance to apply the changes.
4. You can now use GCP integration with service account impersonation.
</Step>
</Steps>
After configuring the appropriate roles, press "DONE".
</Step>
<Step title="Enable Service Account Impersonation">
To enable service account impersonation, you'll need to grant the **Service Account Token Creator** role to the Infisical instance's service account. This configuration allows Infisical to securely impersonate the new service account.
- Navigate to the IAM & Admin > Service Accounts section in your Google Cloud Console
- Select the newly created service account
- Click on the "PERMISSIONS" tab
- Click "Grant Access" to add a new principal
If you're using Infisical Cloud US, use the following service account: `[email protected]`
If you're using Infisical Cloud EU, use the following service account: `[email protected]`
If you're self-hosting, follow the "Self-Hosted Instance" guide at the top of the page and then use service account you created

</Step>


When generating these secrets, it's important to specify a Time-to-Live (TTL) duration. This will dictate how long the credentials are valid for.

<Tip>
Ensure that the TTL for the lease falls within the maximum TTL defined when configuring the dynamic secret.
</Tip>
Once you click the `Submit` button, a new secret lease will be generated and the credentials from it will be shown to you.

Once you have created one or more leases, you will be able to access them by clicking on the respective dynamic secret item on the dashboard.
This will allow you to see the expiration time of the lease or delete a lease before its set time to live.
To extend the life of the generated dynamic secret leases past its initial time to live, simply click on the Renew button as illustrated below.
<Warning> Lease renewals cannot exceed the maximum TTL set when configuring the dynamic secret </Warning>