Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timakin/ssm2env
Environments injection tool for AWS EC2, with SSM (EC2 Parameter Store).
https://github.com/timakin/ssm2env
Last synced: about 1 month ago
JSON representation
Environments injection tool for AWS EC2, with SSM (EC2 Parameter Store).
- Host: GitHub
- URL: https://github.com/timakin/ssm2env
- Owner: timakin
- Created: 2017-07-26T13:51:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-26T14:16:33.000Z (about 7 years ago)
- Last Synced: 2024-06-20T14:20:23.157Z (5 months ago)
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ssm2env
Environments injection tool with parameters fetched from AWS (Amazon System Manager EC2 Parameter Store).# Install
```
$ go get -u github.com/timakin/ssm2env
```# Prepare
At first, set your own parameters to SSM, EC2 parameter store.
Notice: Please set the prefix for parameters with dots.
ex) `testapi.prod.DB_PASSWORD`
```
$ aws ssm get-parameters --with-decryption --names testapi.prod.DB_USER testapi.prod.DB_PASSWORD
{
"InvalidParameters": [],
"Parameters": [
{
"Type": "String",
"Name": "testapi.prod.DB_USER",
"Value": "root"
},
{
"Type": "SecureString",
"Name": "testapi.prod.DB_PASSWORD",
"Value": "password"
}
]
}
```# Usage
Inside your server with aws credentials, just type `SSM2ENV_PREFIX=testapi.prod ssm2env [-v]` .
This command will generate the script to export the environments.
After reproduction a process, init script will be called and it'll export above variables.
If you'd set envs immediately, just call the raw script file. `source /etc/profile.d/loadenv_fromssm.sh`