# launch ec2 instance without instance\_ids

**URL:** <https://forum.ansible.com/t/launch-ec2-instance-without-instance-ids/17910>\
**Category:** Ansible Project\
**Created:** [April 6, 2015, 12:40pm UTC](https://forum.ansible.com/t/launch-ec2-instance-without-instance-ids/17910 "2015-04-06T12:40:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Barmotin](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@Pavel\_Barmotin](https://forum.ansible.com/u/Pavel_Barmotin)\
**Post date:** [April 6, 2015, 12:40pm UTC](https://forum.ansible.com/t/launch-ec2-instance-without-instance-ids/17910/1 "2015-04-06T12:40:21Z")

</div>

Hello Guys,  
I want run stopped ec2 instance using count\_tag and exact\_count and not using instance\_ids.

`

- name: launch ec2 instance  
ec2:  
instance\_type: m3.medium  
key\_name: “{{ec2\_key}}”  
group: web  
image: “{{ec2\_ami}}”  
vpc\_subnet\_id: subnet-8c16c0d5  
instance\_tags:  
Name: “{{ec2\_hostname}}”  
exact\_count: 1  
count\_tag:  
Name: “{{ec2\_hostname}}”  
region: eu-west-1  
wait: yes  
assign\_public\_ip: yes  
aws\_access\_key: “{{aws\_access\_key}}”  
aws\_secret\_key: “{{aws\_secret\_key}}”  
#state: running  
register: ec2  
always\_run: yes

`

using count\_tag and exact\_count working properly, but it conflict with state.

If I run playbook when instance stopped - I get new instance.

How to resolve my issue?  
Thanks
