def _parse_template(cf_client, template):
    """Parse and validate the cloudformation template file.

    Parameters
    ----------
    cf_client : object
        Cloudformation client for performing stack operations.
    template : str
        Filename of the cloudformation template.

    Returns
    -------
    str
        Cloudformation template data.
    """
    with open(template) as template_fileobj:
        template_data = template_fileobj.read()
    cf_client.validate_template(TemplateBody=template_data)
    return template_data
