diff --git a/aws_requests_auth/boto_utils.py b/aws_requests_auth/boto_utils.py index 51fcc7a..d5e1171 100644 --- a/aws_requests_auth/boto_utils.py +++ b/aws_requests_auth/boto_utils.py @@ -31,7 +31,7 @@ def get_credentials(credentials_obj=None): class BotoAWSRequestsAuth(AWSRequestsAuth): - def __init__(self, aws_host, aws_region, aws_service): + def __init__(self, aws_host, aws_region, aws_service, profile=None): """ Example usage for talking to an AWS Elasticsearch Service: @@ -44,7 +44,7 @@ def __init__(self, aws_host, aws_region, aws_service): http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials """ super(BotoAWSRequestsAuth, self).__init__(None, None, aws_host, aws_region, aws_service) - self._refreshable_credentials = Session().get_credentials() + self._refreshable_credentials = Session(profile=profile).get_credentials() def get_aws_request_headers_handler(self, r): # provide credentials explicitly during each __call__, to take advantage