Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietsao authored Sep 7, 2017
1 parent 0da6525 commit 153723f
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
# aws-ssm-env
Simple utility to print parameters from Amazon EC2 Systems Manager Parameter Store as environment variables. This is useful for injecting secure secrets into the environment of a docker container.
Simple utility to print parameters from Amazon EC2 Systems Manager Parameter Store as environment variables. This is useful for injecting secure secrets into the environment of a docker container process.

### Usage
TODO
Create secret parameters on AWS Parameter Store for your application using [hierarchies](http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-working.html#sysman-paramstore-su-organize) :
```
> aws ssm put-parameter --name /production/app-1/SECRET_1 --value "123456" --type SecureString --key-id <your-key-id> --region <aws-region>
> aws ssm put-parameter --name /production/app-1/secret_2 --value "abcdef" --type SecureString --key-id <your-key-id> --region <aws-region>
```
Use `export` with `aws-ssm-env` to inject secrets from Parameter Store into the environment:
```
> export $(AWS_REGION=<aws-region> aws-ssm-env -paths /production/app-1/)
> env
...
...
SECRET_1=123456
SECRET_2=abcdef
```
Notice that parameter names are automatically capitalized

Multiple hierarchy paths can be passed in vis `-paths` (comma separated):
```
> aws ssm put-parameter --name /production/common/common_secret --value "foobarbaz" --type SecureString --key-id <your-key-id> --region <aws-region>
> export $(AWS_REGION=<aws-region> aws-ssm-env -paths /production/app-1/,/production/common/)
> env
...
...
SECRET_1=123456
SECRET_2=abcdef
COMMON_SECRET=foobarbaz
```

### Author
Jamie Tsao
Expand Down

0 comments on commit 153723f

Please sign in to comment.