benzoin.py 文件源码

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

项目:benzoin 作者: mpilar 项目源码 文件源码
def initialize_snapshot_tags(event, context):
    """
    Event comes in with snapshot info, make sure we"re working with a snapshot
    we"re supposed to and wait for it to be done snapshotting.
    """
    session = boto3.session.Session(region_name=event.get("region"))

    ec2 = session.resource("ec2")

    snapshot_ids = [vol["snapshot-id"] for vol in event.get("backup-volumes")]
    for sid in snapshot_ids:
        if ec2.Snapshot(sid).state != "completed":
            raise NotReady("Snapshot not ready")

    return event
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号