Integrations
GCP Secrets Manager
How to continuously sync your secrets with Google Cloud Secrets Manager.
Prerequisites
- You have a GCP account and are familiar with GCP Secret Manager
- You have the gcloud CLI installed and authenticated
- You have enabled the Secret Manager API for your GCP project
Ensure the gcloud CLI is configured to use the correct project, e.g. gcloud config set project [your-project]
before proceeding.
Setup
-
Create new IAM Service Account
Run the following commands with the gcloud CLI.
-
Create keys for the new service account
Copy and save the keys printed on your shell.
-
Configuration
- Go to integrations catalog in your envsecrets dashboard and choose “GCP Secrets Manager.”
- On the setup/connection page, enter the service account keys you created above and save the form.
We will enable “Automatic Replication” for your GCP secret by default. You can learn more about this from GCP Secret Manager replication docs.
Activation
- Go to the integrations dashboard in your envsecrets organisation and under “GCP Secrets Manager” choose “Sync New Environment With Your GCP Secrets Manager Account.”
- In the page that opens, select your envsecrets project, environment and enter the name with which you wish you save your secret in GCP Secrets Manager.
- Complete and save the form.
Usage
Platform
- Navigate to the environment for which you activated the integration.
- Click on the “Sync” button.
- Choose the GSM Secret to which you want to sync your secrets.
- Approve the sync.
CLI
- Use the command:
envs sync --env [name-of-your-remote-environment]
- Choose the GSM integration.
Once your secrets are synced, it is recommended you go to your Gitlab repository and validate the new values.
Every new version of your secret in envsecrets will create a new version of the existing secret in GCP Secrets Manager.