handler.py 文件源码

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

项目:aws-tailor 作者: alanwill 项目源码 文件源码
def get_la_vpc_id(la_credentials, region):

    # Lookup vpcid
    laCfn = boto3.client(
        'cloudformation',
        region_name=region,
        aws_access_key_id=la_credentials[0],
        aws_secret_access_key=la_credentials[1],
        aws_session_token=la_credentials[2],
    )
    # Look up CFN stack Outputs
    getStack = laCfn.describe_stacks(
        StackName='core'
    )

    # Extract vpc id
    laVpcId = None
    cfnOutput = getStack['Stacks'][0]['Outputs']
    for i in cfnOutput:
        if i['OutputKey'] == "VPC":
            laVpcId = i['OutputValue']
        else:
            continue

    return laVpcId
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号