import boto3 from requests_aws4auth import AWS4Auth from conf import config credentials = boto3.Session().get_credentials() awsauth = AWS4Auth(config.AWS_ACCESS_KEY_ID, config.AWS_SECRET_ACCESS_KEY, config.AWS_REGION, 'es', session_token=credentials.token)