Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
botoenv script
Browse files Browse the repository at this point in the history
  • Loading branch information
nelhage committed Mar 29, 2016
1 parent 6cedeb6 commit bf7138f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions botoenv
@@ -0,0 +1,13 @@
#!/usr/bin/env python
import boto3.session
import sys
import os

s = boto3.session.Session()
creds = s._session.get_credentials()
os.environ['AWS_ACCESS_KEY_ID'] = creds.access_key
os.environ['AWS_SECRET_ACCESS_KEY'] = creds.secret_key
if creds.token:
os.environ['AWS_SESSION_TOKEN'] = creds.token
os.environ['AWS_DEFAULT_REGION'] = s._session.get_config_variable('region')
os.execvp(sys.argv[1], sys.argv[1:])

0 comments on commit bf7138f

Please sign in to comment.