__init__.py 文件源码

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

项目:aws-sudo 作者: voytek-solutions 项目源码 文件源码
def get_session(profile_config):
    session_profile = profile_config['profile_name']

    if 'source_profile' in profile_config:
        session_profile = profile_config['source_profile']

    if 'region' in profile_config:
        os.putenv('AWS_DEFAULT_REGION', profile_config['region'])
        os.putenv('AWS_REGION', profile_config['region'])

    # Create a session using profile or EC2 Instance Role
    # To use Instance Role set `source_profile` to empty string in aws profile
    # configuration file
    session = boto3.Session(profile_name=session_profile)

    return session
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号