As you probably experienced, it's not possible to use variables for
dict keys, so something like this:
instance_tags:
"{{ tag1 }}": "{{ value1 }}"
would actually result in the literal string '{{ tag1 }}' for the tag...
What I usually end up doing in scenarios like this, is to define a
list of dicts, with 'key' and 'value' keys, where you CAN define their
values, and then transform that structure use items2dict.
So in your case: