Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Set boto3 to use aws profile session
Browse files Browse the repository at this point in the history
This change sets the default boto3 session to use the aws profile
and credentials that we specify on the command line. Whenever we
set the fabric env.aws we will now also change the boto3 default
session to reflect that.
  • Loading branch information
Niall Creech committed Feb 27, 2016
1 parent a116ff2 commit b770636
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bootstrap_cfn/fab_tasks.py
Expand Up @@ -6,6 +6,8 @@
import time
import uuid

import boto3

import dns.resolver

from fabric.api import env, task
Expand Down Expand Up @@ -58,6 +60,8 @@ def aws(profile_name):
variable to
"""
env.aws = str(profile_name).lower()
# Setup boto so we actually use this environment
boto3.setup_default_session(profile_name=env.aws)


@task
Expand Down

0 comments on commit b770636

Please sign in to comment.