s3env

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 14 Imported by: 0

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.

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL