validation_script.py 文件源码

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

项目:benzoin 作者: mpilar 项目源码 文件源码
def are_snapshots_tagged(region, snapshot_ids):
    """Check the current snapshot tags to prevent multiple snapshots."""
    session = boto3.session.Session(region_name=region)
    ec2 = session.resource('ec2')

    for sid in snapshot_ids:
        snapshot = ec2.Snapshot(sid)
        current_tags = snapshot.tags
        if not current_tags:
            continue
        for tag in current_tags:
            if tag.get("Key") == VALIDATION_TAG_KEY:
                return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号