This message was deleted.
# python
s
This message was deleted.
p
just to make sure, the version returning
pulumi.Output
works as expected?
p
Yep
And I'm on python 3.7
p
is
render_template_file
defined by you?
if so, can you paste its code here as well so others could easily repro this?
p
Yep, 1 minute
Copy code
from jinja2 import Environment, PackageLoader, StrictUndefined, select_autoescape

def templating_env() -> Environment:
    """Returns a Jinja templating environment that pulls templates from the `infra.templates` package.

    If any expected variables are missing from a template rendering,
    an error will be thrown.

    """
    return Environment(
        loader=PackageLoader("infra"),
        autoescape=select_autoescape(),
        undefined=StrictUndefined,
    )


def render_template_file(
    env: Environment, template_name: str, kwargs: Mapping[str, Any]
) -> str:
    """
    Render the given Jinja template with the given arguments.
    """
    template = env.get_template(template_name)
    return template.render(**kwargs)