Table of Contents
A showcase on how to get secrets with AWS Secrets manager - nodejs
aws secretsmanager create-secret --name "fbi/secrets/dev" --secret-string file:https://dev.json
aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev"
# update dev.json
$ aws secretsmanager put-secret-value --secret-id "fbi/secrets/dev" --secret-string file:https://dev.json |jq -r .SecretString
$ aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev" --version-stage AWSCURRENT |jq -r .SecretString
$ aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev" --version-stage AWSPREVIOUS |jq -r .SecretString
$ npm install
$ TEAM=fbi PROJECT=secrets ENVIRONMENT=prod node main.js
fbi/secrets/prod
{ env: 'prod', foo: 'rab' }
rab
$ TEAM=fbi PROJECT=secrets ENVIRONMENT=dev node main.js
fbi/secrets/dev
{ env: 'dev', foo: 'bar' }
bar