Skip to main content

Google Secret Manager

Product Page

Secret Manager | Google Cloud

Research Repository

Sign in

Agate Secret Naming Standards (snake-lower-case)

Primary

<ProjectName>-<AppOrServicesName>-<EnvName>-Secret (e.g. memories-gameapi-prod-secret )

Secondary

<project name>-secret (e.g. memories-secret

What is Secret Manager ?

Secret manager is a secure and convenient storage system for API keys, password, certificate, and other sensitive data. So if you use secret manager, you don’t need to save API keys, password or other sensitive data in your code.

Secret Manager Cost Factors

sorted descending by cost per usage

  1. Secret Count - number of secret inside a project
  2. Secret Versions - Number of version of a secret.
  3. Secret Requests - number of request to access the secret.

Create Secret Manager

In this here, we will use Google Cloud Platform (GCP) for create a secret manager. Open the Goole Cloud Platform (GCP) and open secret manager menu, or in GCP console you can search “secret manager” then click “secret manager”

secretmanager.png

and after that, click “Create secret”

createsecret.PNG

Input Name with your secret name and input Secret Value with your sensitive data like password, or other sensitive data and after that you can click button Create Secret

And after that you can export google application credential (for this you can ask to devops team) save google application credential to your directory

Integrate Secret Manager to Google Cloud Platform (GCP)

clone the backend template:

Sign in

  • open the command prompt/terminal from the root folder in this project

  • type dotnet restore

  • open game-api and admin-api, after that, go to folder Properties/launchsetting.json

json.PNG

change PROJECT_ID to your project id name and set GOOGLE_APPLICATION_CREDETIALS to your directory you save google application credentials and set USE_SECRET to true and after that you can try to run the project