Referencing Turbot Account Tags with spaces in the key name

When referencing Turbot Account tags with spaces in the name, use the below pattern:

- "Primary Owner": "{{ account.tags['Primary Owner'] }}"

The template is plain YAML with Jinja2 templating.

Breakdown of Elements:

- "Primary Owner": "

This is just plain text that establishes the key name for the desired tag.

{{ account.tags['Primary Owner'] }}

Jinja2 templating referencing the Turbot Account tags, specifically the 'Primary Owner' tag.

Common Error to Avoid

A common error is to do:

{{ account.['Primary Owner'] }}

This tells Turbot to go look at the Turbot Account data structure which doesn't have a field called "Primary Owner", so the tag value will be a zero length string.

Was this article helpful?
0 out of 0 found this helpful