# EC2\_ASG module failure

**URL:** <https://forum.ansible.com/t/ec2-asg-module-failure/24527>\
**Category:** Ansible Project\
**Created:** [May 19, 2017, 6:35pm UTC](https://forum.ansible.com/t/ec2-asg-module-failure/24527 "2017-05-19T18:35:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taylor\_Lewick](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Taylor\_Lewick](https://forum.ansible.com/u/Taylor_Lewick)\
**Post date:** [May 19, 2017, 6:35pm UTC](https://forum.ansible.com/t/ec2-asg-module-failure/24527/1 "2017-05-19T18:35:02Z")

</div>

I am trying to create an ASG from within a playbook. Running ansible 2.2.1 from Mac OS.

Playbook below:

`  
#setup Logstash Autoscaling group

- name: ELkstack LogStash ASG  
ec2\_asg:  
name: “pro-ELK-LogStash-ASG”  
launch\_config\_name: “test-logstash-asg”  
health\_check\_period: 300  
health\_check\_type: EC2  
replace\_all\_instances: yes  
replace\_batch\_size: 1  
min\_size: 1  
max\_size: 4  
desired\_capacity: 1  
region: us-east-1

`

And when I run this, I get the following error. This is in a playbook that I also am setting up Security groups, elastic load balancer, launch config, tag assets, etc. All of these tasks work. I’ve moved this portion to its own test playbook, and this is the only portion of the playbook that fails.

here is the -vvv output

`An exception occurred during task execution. The full traceback is:`  
Traceback (most recent call last):  
File “/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py”, line 875, in   
main()  
File “/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py”, line 864, in main  
create\_changed, asg\_properties=create\_autoscaling\_group(connection, module)  
File “/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py”, line 437, in create\_autoscaling\_group  
launch\_config=launch\_configs[0],  
IndexError: list index out of range

fatal: [localhost]: FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“invocation”: {  
“module\_name”: “ec2\_asg”  
},  
“module\_stderr”: “Traceback (most recent call last):\n File "/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py", line 875, in \n main()\n File "/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py", line 864, in main\n create\_changed, asg\_properties=create\_autoscaling\_group(connection, module)\n File "/var/folders/08/x2n75q\_925l5xc9hfjc1gz9c0000gn/T/ansible\_38fX0z/ansible\_module\_ec2\_asg.py", line 437, in create\_autoscaling\_group\n launch\_config=launch\_configs[0],\nIndexError: list index out of range\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE”  
}

Any help or ideas is appreciated…
