Configure a Secret Manager secret

In Application Design Center, you can configure a Secret Manager secret to securely store and manage access to API keys, passwords, certificates, and other sensitive application data. You can customize the secret's component connections and configuration parameters based on the terraform-google-secret-manager Terraform module on GitHub.

Component connections

The following table includes the components that you can connect to Secret Manager, and the resulting updates to your application and its generated Terraform code.

Connected component Application updates Background information
Service account
  • The service account can access the secret data.
  • The roles/secretmanager.secretAccessor role is granted to the service account.
Manage access to secrets
Cloud Run
  • The Cloud Run service can reference the secret data.
  • The Secret Manager Secret Data field is referenced by the Cloud Run env_secret_vars field.
  • The roles/secretmanager.secretAccessor role is granted to the Cloud Run service account.
Configure secrets for services
Cloud SQL (MySQL)
  • Secret Manager stores user information.
  • The Secret Manager Secret Data field contains the password for the default user.
Use Secret Manager to handle secrets in Cloud SQL
Cloud SQL (PostgreSQL)
  • Secret Manager stores user information.
  • The Secret Manager Secret Data field contains the password for the default user.
Use Secret Manager to handle secrets in Cloud SQL

Required configuration parameters

If your template includes a Secret Manager component, you must configure the following parameters before you deploy.

Parameter name Description and constraints Background information

Project ID

The project where you want to deploy the Secret Manager resource.

Configure components

Name

The name of the secret to create.

Create a secret

Secret Data

The secret data, which must be no larger than 64 KiB. This property is sensitive and isn't displayed in the plan.

Create a secret

Optional configuration parameters

The following parameters are optional. To display advanced parameters, in the Configuration area, select Show advanced fields.

Feature Parameter name Description and constraint information Background information
Rotation Rotation period rotationPeriod About rotation schedules
Rotation Next rotation time nextRotationTime Create and manage rotation schedules
User-managed replication Region location User-managed replication
User-managed replication KMS key name kmsKeyName User-managed replication
Automatic replication KMS key name kmsKeyName Automatic replication

Topics

topics Set up notifications on a secret
Labels Key labels Add labels to secrets
Labels Value labels Add labels to secrets