def copy_remote()

in lambda/snapshots_tool_utils.py [0:0]


def copy_remote(snapshot_identifier, snapshot_object):
    client = boto3.client('rds', region_name=_DESTINATION_REGION)

    if snapshot_object['StorageEncrypted']:
        logger.info('Copying encrypted snapshot %s to remote region %s' %
                    (snapshot_object['Arn'], _DESTINATION_REGION))

        response = client.copy_db_cluster_snapshot(
            SourceDBClusterSnapshotIdentifier=snapshot_object['Arn'],
            TargetDBClusterSnapshotIdentifier=snapshot_identifier,
            KmsKeyId=_KMS_KEY_DEST_REGION,
            SourceRegion=_REGION,
            CopyTags=True)

    else:
        logger.info('Copying snapshot %s to remote region %s' %
                    (snapshot_object['Arn'], _DESTINATION_REGION))

        response = client.copy_db_cluster_snapshot(
            SourceDBClusterSnapshotIdentifier=snapshot_object['Arn'],
            TargetDBClusterSnapshotIdentifier=snapshot_identifier,
            SourceRegion=_REGION,
            CopyTags=True)

    return response