Add an entry to our secrets that is stored on AWS
The below steps assume that you have the correct account privileges in AWS.
- Log in to your HCA’s AWS account
- Make sure that you are at the right AWS region otherwise you won’t able to see/manage our secrets stored in the Secret Manager. The region should be set to:
us-east-1(N. Virginia) - Go to Secrets Manager. You can do it with any of the follong way:
- click
Secrets Manageron the recently visited links section if it is not your first time, - select the Services drop-down and in the Security, Identity, & Compliance section click on
Secrets Managerlink, - Type
Secters Managerinto the search bar and click on the appearingSecrets Managerlink
- click
- Click on the Secrets option on the left hand side menu bar
- Depending on which environment you would like to add the new secret you should type
ingest/{ENV_NAME}/secretsto the search bar whereENV_NAMEis a placeholder and can be the following values:dev,stagingandprod. - Click on the name of the secret, for example
ingest/dev/secrets. - Scroll down to the
Secret valuesection and click on theRetrieve secret valuebutton. - Click on the
Editbutton and add your secrets as key/value pairs. - When you finished adding all your new secrets click on the
Savebutton to store it.
You can find the official AWS documentation on how to update secrets here.
Add a secret to the deployment as environment variable
- Modify the
deployment.yamlfile underapps/<APPLICATION_NAME>/templatesfolder, whereAPPLICATION_NAMEreflects the name of the application the secrets will be used - Adds your secret under the environment variables (
spec.template.spec.containers.env). Define the name and value of your environment variable. If the value comes from AWS secret manager then use this format:- name: ENV_VARIABLE_NAME valueFrom: secretKeyRef: key: SERVICE-PASSWORD name: secret-name
Add secret to the deployment configuration
- Modify the
deploy_secretsshell script under thescriptsfolder and add your secret value below theget_secretmethod call and after thehelm upgrade secrets secrets\line as you can see it the script.
Define your secret in the deployment template
- Modify the
deployment.yamlfile undersecrets/templatesfolder.
Deploy the new secret value
- Go to the
appsfolder - Execute the following command in the command line:
make deploy-secrets