awsumepy.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:awsume 作者: trek10inc 项目源码 文件源码
def create_boto_sts_client(profileName=None, secretAccessKey=None, accessKeyId=None, sessionToken=None):
    """
    profileName - the name of the profile to create the client with;
    secretAccessKey - secret access key that can be passed into the session;
    accessKeyId - access key id that can be passed into the session;
    sessionToken - session token that can be passed into the session;
    return a boto3 session client
    """
    log.info('Creating a Boto3 STS client')
    log.debug('profile_name=' + str(profileName))
    log.debug('aws_access_key_id=' + str(accessKeyId))
    log.debug('aws_secret_access_key=' + str(secretAccessKey))
    log.debug('aws_session_token=' + str(sessionToken))
    #establish the boto session with given credentials
    botoSession = boto3.Session(profile_name=profileName,
                                aws_access_key_id=accessKeyId,
                                aws_secret_access_key=secretAccessKey,
                                aws_session_token=sessionToken)
    #create an sts client, always defaulted to us-east-1
    return botoSession.client('sts', region_name='us-east-1')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号