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 Manager
on 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 Manager
link, - Type
Secters Manager
into the search bar and click on the appearingSecrets Manager
link
- 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}/secrets
to the search bar whereENV_NAME
is a placeholder and can be the following values:dev
,staging
andprod
. - Click on the name of the secret, for example
ingest/dev/secrets
. - Scroll down to the
Secret value
section and click on theRetrieve secret value
button. - Click on the
Edit
button and add your secrets as key/value pairs. - When you finished adding all your new secrets click on the
Save
button 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.yaml
file underapps/<APPLICATION_NAME>/templates
folder, whereAPPLICATION_NAME
reflects 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_secrets
shell script under thescripts
folder and add your secret value below theget_secret
method 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.yaml
file undersecrets/templates
folder.
Deploy the new secret value
- Go to the
apps
folder - Execute the following command in the command line:
make deploy-secrets