import json
from typing import OrderedDict


def read_cfn_template(template_path):
    """Read the existing CFN template from the given path."""
    with open(template_path) as cfn_file:
        # object_pairs_hook=OrderedDict allows to preserve input order
        return json.load(cfn_file, object_pairs_hook=OrderedDict)