How to pass a variable to a filter plugin ?

Hi All,

First of all, Happy New Year to everybody. :slight_smile:

I would like to know if it is possible to pass a variable to a filter.

I have this code that works with a predefined text:

"{{ ec2_vpc_out.subnets | get_subnets(‘Name’, ’TheName’) | first }}”

Now I need to replace the ‘TheName’ argument with a variable. E.g.:

"{{ ec2_vpc_out.subnets | get_subnets(‘Name’, <item.name>) | first }}”

Is there a way of doing this ?

Thanks,
Gustavo Aguiar

It should be this simple:

"{{ ec2_vpc_out.subnets | get_subnets('Name', item.name) | first }}”

Thank you Brian! I was adding the ’ and this was breaking my tests…

Thanks again,
—Gustavo