def get_latest_snapshot_ts()

in lambda/snapshots_tool_utils.py [0:0]


def get_latest_snapshot_ts(cluster_identifier, filtered_snapshots):

    # Get latest snapshot for a specific DBClusterIdentifier
    timestamps = []

    for snapshot, snapshot_object in filtered_snapshots.items():

        if snapshot_object['DBClusterIdentifier'] == cluster_identifier:

            timestamp = get_timestamp_no_minute(snapshot, filtered_snapshots)

            if timestamp is not None:

                timestamps.append(timestamp)

    if len(timestamps) > 0:

        return max(timestamps)

    else:
        return None