Skip to content
Manage AWS environment variables using botocore
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.globality Circle 1->2 (#2) Jul 6, 2018
botoenv
.ackrc Initial version Apr 5, 2017
.bumpversion.cfg Bump Jul 13, 2017
.gitignore Initial version Apr 5, 2017
CONTRIBUTING.md Initial version Apr 5, 2017
LICENSE Initial commit Apr 5, 2017
MANIFEST.in Circle 1->2 (#2) Jul 6, 2018
README.md It's important to have a region for every profile Apr 5, 2017
setup.cfg Initial version Apr 5, 2017
setup.py
tox.ini Initial version Apr 5, 2017

README.md

botoenv

Manage AWS environment variables using botocore

Installation

pip install botoenv

Usage

By default, botoenv prints out environment variable assignments for the current AWS credentials.

The expected usage is to eval its output:

eval $(botoenv)

Profiles

AWS supports role assumption via profiles in your ~/.aws configuration.

For example, in ~/.aws/config:

[default]
region = us-east-1

[profile development]
region = us-east-1
source_profile = default

[profile production]
region = us-west-2
source_profile = default

Then, in ~/.aws/credentials:

[default]
aws_access_key_id = <redacted>
aws_secret_access_key = <redacted>

[development]
role_arn = arn:aws:iam::account_id:role/development

[production]
role_arn = arn:aws:iam::account_id:role/production

If you have both the source_profile and role_arn configured, you can use botoenv to automtically invoke the STS Assume Role function:

eval $(botoenv --profile development)

Template Customization

The template output can be configured. For example:

eval $(botoenv --template $'unset {key}\n')
You can’t perform that action at this time.