# Error when using ec2\_asg

**URL:** <https://forum.ansible.com/t/error-when-using-ec2-asg/17347>\
**Category:** Ansible Project\
**Created:** [January 22, 2015, 8:12am UTC](https://forum.ansible.com/t/error-when-using-ec2-asg/17347 "2015-01-22T08:12:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Citek](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@Robert\_Citek](https://forum.ansible.com/u/Robert_Citek)\
**Post date:** [January 22, 2015, 8:12am UTC](https://forum.ansible.com/t/error-when-using-ec2-asg/17347/1 "2015-01-22T08:12:33Z")

</div>

Hello all,

I am trying to create an Auto-Scaling Group using ansible. This is  
the playbook:

$ tail -n +1 auto.scaling.group.yml  
- hosts: localhost  
&nbsp;&nbsp;connection: local  
&nbsp;&nbsp;gather\_facts: False

&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;&nbsp;- name: create auto-scaling group  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ec2\_asg:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "MRA"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;launch\_config\_name: "mail-relay - ansible"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;region: "eu-west-1"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;availability\_zones: ['eu-west-1a', 'eu-west-1b', 'eu-west-1c']  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vpc\_zone\_identifier: ['subnet-8cfaf2ab']  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;min\_size: 0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max\_size: 10  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;desired\_capacity: 0

However, when I run it with this command:

$ ansible-playbook auto.scaling.group.yml -vvv

I get this error:  
...  
failed: [localhost] =\> {"failed": true}  
msg: BotoServerError: 400 Bad Request  
\<ErrorResponse xmlns="[http://autoscaling.amazonaws.com/doc/2011-01-01/&quot;&gt](http://autoscaling.amazonaws.com/doc/2011-01-01/&quot;&gt);  
&nbsp;&nbsp;\<Error\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<Type\>Sender\</Type\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<Code\>ValidationError\</Code\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<Message\>The subnet ID '['subnet-8cfaf2ab']' does not exist\</Message\>  
&nbsp;&nbsp;\</Error\>  
&nbsp;&nbsp;\<RequestId\>90ee5366-a20d-11e4-b9e5-294dcdf4fd56\</RequestId\>  
\</ErrorResponse\>

FATAL: all hosts have already failed -- aborting  
...

That subnet does exist as I did a copy/paste straight from an ASG that  
I created by hand.

I suspect my error may be elsewhere, but I am not seeing it. Any  
thoughts on what I am doing wrong?

Regards,  
- Robert
