Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sachaos/s3env
Load environment variables from AWS S3
https://github.com/sachaos/s3env
aws aws-s3 dotenv environment-variables
Last synced: about 1 month ago
JSON representation
Load environment variables from AWS S3
- Host: GitHub
- URL: https://github.com/sachaos/s3env
- Owner: sachaos
- License: mit
- Created: 2017-11-05T20:59:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T15:08:06.000Z (over 1 year ago)
- Last Synced: 2024-06-20T19:23:55.381Z (5 months ago)
- Topics: aws, aws-s3, dotenv, environment-variables
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
s3env
===## Description
Load environment variables from AWS S3.
## Usage
### Setup
#### 1. Upload environment variable
Create a bucket and, put a dotenv format file.
Optionally, you can use base64 encoded file.```
$ cat dotenv
# This is a comment
ENABLE_DEBUG_MODE=y # comment
ENABLE_TEST_MODE=${ENABLE_DEBUG_MODE}"$ cat dotenv | base64 | aws s3 cp - s3://your-bucket-name/dotenv # Upload to s3
```#### 2. Set AWS credential and s3env environment variables
Set below environment variables, and [aws credential environment variables](http://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html).
```
S3ENV_BASE64ENCODE=y
S3ENV_BUCKET_NAME=your-bucket-name
S3ENV_KEY_NAME=dotenv
```### Use environment variable from S3
#### Load to current shell
```
$ source <(s3env show --export)
$ echo $ENABLE_DEBUG_MODE
y
```#### Run with some command
```
$ s3env run irb
irb(main):001:0> ENV["ENABLE_DEBUG_MODE"]
=> "y"
```## Inspired by
* [the40san/dotenv-s3: load your dotenv from s3](https://github.com/the40san/dotenv-s3)
* [timakin/ssm2env: Environments injection tool for AWS EC2, with SSM (EC2 Parameter Store).](https://github.com/timakin/ssm2env)
* [okzk/env-injector](https://github.com/okzk/env-injector)