backuplambda.py 文件源码

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

项目:aws-backup-lambda 作者: cevoaustralia 项目源码 文件源码
def snapshot_resource(self, resource, description, tags):

        aws_tagset = []
        for k in tags:
            aws_tagset.append({"Key": k, "Value": tags[k]})

        date = datetime.today().strftime('%d-%m-%Y-%H-%M-%S')
        snapshot_id = self.period + '-' + self.resolve_backupable_id(resource) + "-" + date + "-" + self.date_suffix

        if 'DBClusterIdentifier' in resource:
            current_snap = self.conn.create_db_cluster_snapshot(
                DBClusterIdentifier=self.resolve_backupable_id(resource),
                DBClusterSnapshotIdentifier=snapshot_id,
                Tags=aws_tagset)
        else:
            current_snap = self.conn.create_db_snapshot(DBInstanceIdentifier=self.resolve_backupable_id(resource),
                                                        DBSnapshotIdentifier=snapshot_id,
                                                        Tags=aws_tagset)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号