Google Secret Manager
Product Page
Research Repository
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
- Secret Count - number of secret inside a project
- Secret Versions - Number of version of a secret.
- 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”
and after that, click “Create secret”
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:
-
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
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
No Comments