# Working with variables

**URL:** <https://forum.ansible.com/t/working-with-variables/18737>\
**Category:** Ansible Project\
**Created:** [July 12, 2015, 5:59pm UTC](https://forum.ansible.com/t/working-with-variables/18737 "2015-07-12T17:59:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Popov1](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alexander\_Popov1](https://forum.ansible.com/u/Alexander_Popov1)\
**Post date:** [July 12, 2015, 5:59pm UTC](https://forum.ansible.com/t/working-with-variables/18737/1 "2015-07-12T17:59:41Z")

</div>

I not found answers in documentation, sorry if its lame, it’s my first day with ansible

i’m creating vpc:

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:

```auto
subnets:
      - subnet-xxxxxxxx
      - subnet-zzzzzzzz

```

```auto
 How can i convert vpc.subnets array to array of ids? What if i need filter them by tag ? 

```

```auto
Does it any analog for map of filter operations in ansible?

```

```auto

```
