ec2_vpc:
state: present
cidr_block: 172.30.0.0/16
subnets:
- cidr: 172.30.3.0/24
az: ..
resource_tags: { "tag" : "tag1" }
- cidr: 172.30.1.0/24
az: "{{ region }}a"
resource_tags: { ""tag" : "tag1" }
register: vpc
its assign value to vpc with array of subnets:
"subnets": [
{
"id": "subnet-zzzzzzz",
"resource_tags": {...
}
.. .
},
{
"id": "subnet-xxxxxxx",
"resource_tags": {...
}
...
}
},
for some other calls I need this subnets in different forms
for example ec2_elb_lb requires list of ids:
subnets:
- subnet-xxxxxxxx
- subnet-zzzzzzzzHow can i convert vpc.subnets array to array of ids? What if i need filter them by tag ?
Does it any analog for map of filter operations in ansible?