Secret Manager Demo with Spring Cloud GCP

Secret Manager Property Source

At the bootstrap phase, we loaded the following secret into the application context:

application-secret: [[${applicationSecret}]]
my-application-secret: [[${myApplicationSecret}]]

Create, Read, Update and Delete Secrets

Using the form below, you can create/update secrets in Secret Manager, read and delete them. In the controller code, the SecretManagerTemplate is being used to do these operations.

NOTE: In practice, you never want to allow your secrets to be visible as plaintext. This is just a demonstration!

Get Secret by Secret ID

Get a secret by secret ID from Secret Manager. You will receive an error if you try to get a secret ID that does not already exist.

  1. Secret ID:
  2. Version (optional):
  3. Project ID (optional):

Create/Update Secret

This will create a secret if the provided secret ID does not exists. Otherwise it will create version under the provided secret ID.

  1. Secret ID:
  2. Secret Payload:
  3. Project ID (optional):

Delete Secret

This will delete a secret if the provided secret ID exists.

  1. Secret ID:
  2. Project ID (optional):

Secret Manager Operation: [[${message}]]

You can also view your secrets in the Secret Manager UI in Google Cloud Console .