Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: can delimiters be quoted? #35

Closed
thorstenhuhn opened this issue Apr 22, 2019 · 2 comments
Closed

Question: can delimiters be quoted? #35

thorstenhuhn opened this issue Apr 22, 2019 · 2 comments

Comments

@thorstenhuhn
Copy link
Contributor

I recently needed to add an AWS SSM Document to one of my CloudFormation Stacks managed by Qaz. Due to the use of the Jinja-style for variable syntax "{{ variable }}" in SSM documents as well I now get Gen-Time errors "function variable not defined". I know I could change the qaz delimiters by setting a different gen_time value in config.yml but this would lead to different settings in different projects which might confuse my collegues also working on my templates.

My first idea to workaround this was to implement a function rendering a "string" to "{{ string }}" at Gen-time but I would prefer using quotes if possible.

Does anyone know a better way to address this issue?

@daidokoro
Copy link
Owner

daidokoro commented Apr 22, 2019

Hey @thorstenhuhn

You can definitely quote delimiters by using what I call double wrapping.. For example,
say I want {{ variable }} to be represented literally in my config file. I would do the following.

{{ "{{ variable }}" }}

This would literally evaluate to {{ variable }} when executed.

If I wanted to keep the quotes I could do:

{{ `"{{ variable }}"` }}

Which would evaluate to: "{{ variable }}"

@thorstenhuhn
Copy link
Contributor Author

That's awesome, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants