Skip to content

ozbillwang/asm-showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

asm-showcase

A showcase on how to get secrets with AWS Secrets manager - nodejs

Usage

Create the secrets in aws secrets manager console

asm

Create the secrets with aws cli

Create secrets:

aws secretsmanager create-secret --name "fbi/secrets/dev" --secret-string file:https://dev.json

Get secret:

aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev"

Update a secret

# update dev.json
$ aws secretsmanager put-secret-value --secret-id "fbi/secrets/dev" --secret-string file:https://dev.json |jq -r .SecretString

Show current version

$ aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev" --version-stage AWSCURRENT |jq -r .SecretString

Show previous version

$ aws secretsmanager get-secret-value --secret-id "fbi/secrets/dev" --version-stage AWSPREVIOUS |jq -r .SecretString

Retrieve the secret in your application.

$ 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

About

A showcase on how to get secrets with AWS Secrets manager - nodejs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published