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

# Google Cloud Secrets Manager

> How to store secrets in GCP

The GCP secrets manager is a [secrets manager](/component-gallery/secrets-managers) flavor provided with the ZenML `gcp` integration that uses [GCP](https://cloud.google.com/secret-manager) to store secrets.

### When to use it

You should use the GCP secrets manager if:

* a component of your stack requires a secret for authentication, or you want to use secrets inside your steps.

* you're already using GCP, especially if your orchestrator is running in GCP. If you're using a different cloud provider, take a look at the other [secrets manager flavors](/component-gallery/secrets-managers#secrets-manager-flavors).

### How to deploy it

In order to use the GCP secrets manager, you need to enable it [here](https://console.cloud.google.com/marketplace/product/google/secretmanager.googleapis.com).

### How to use it

To use the GCP secrets manager, we need:

* The ZenML `gcp` integration installed. If you haven't done so, run

```
zenml integration install gcp  
```

* The [GCP CLI](https://cloud.google.com/sdk/docs/install) installed and authenticated.

* The ID of the project in which you want to store secrets. Follow [this guide](https://support.google.com/googleapi/answer/7014113?hl=en) to find your project ID.

We can then register the secrets manager and use it in our active stack:

```
zenml secrets-manager register  \
    --flavor=gcp \
    --project_id=

# Add the secrets manager to the active stack
zenml stack update -x 
```

You can now [register, update or delete secrets](/component-gallery/secrets-managers#in-the-cli) using the CLI or [fetch secret values inside your steps](/component-gallery/secrets-managers#in-a-zenml-step).

You can use [secret scoping](/component-gallery/secrets-managers#secret-scopes) with the GCP Secrets Manager to emulate multiple Secrets Manager namespaces on top of a single GCP project.

A concrete example of using the GCP secrets manager can be found [here](https://github.com/zenml-io/zenml/tree/main/examples/cloud%5Fsecrets%5Fmanager).

For more information and a full list of configurable attributes of the GCP secrets manager, check out the [API Docs](https://apidocs.zenml.io/latest/integration%5Fcode%5Fdocs/integrations-gcp/#zenml.integrations.gcp.secrets%5Fmanager.gcp%5Fsecrets%5Fmanager.GCPSecretsManager).
