# ec2\_asg timeout issue

**URL:** <https://forum.ansible.com/t/ec2-asg-timeout-issue/18824>\
**Category:** Ansible Project\
**Created:** [July 22, 2015, 5:11pm UTC](https://forum.ansible.com/t/ec2-asg-timeout-issue/18824 "2015-07-22T17:11:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [July 22, 2015, 5:11pm UTC](https://forum.ansible.com/t/ec2-asg-timeout-issue/18824/1 "2015-07-22T17:11:41Z")

</div>

Hi,

I have the bellow config using the ec2\_asg module :

“”"

# AutoScaling group

- ec2\_asg:  
name: “asg”  
state: present  
region: “{{ region }}”  
load\_balancers: “{{ elb\_name }}”  
availability\_zones: [‘{{ az1 }}’, ‘{{ az2 }}’, ‘{{ az3 }}’]  
launch\_config\_name: “config”  
min\_size: “{{ min\_size }}”  
max\_size: “{{ max\_size }}”  
desired\_capacity: “{{ desired\_capacity }}”  
vpc\_zone\_identifier: “{{ vpc\_zone\_identifier }}”

# Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health

health\_check\_period: 900  
health\_check\_type: ELB  
tags:

- Name: “AutoScalingNode”  
propagate\_at\_launch: true
- Environment: “Dev”  
propagate\_at\_launch: true  
“”"

Unfortunately this task will always fail as my instance needs about 10 minutes to be up and running but this task fails after about 5 minutes with the bellow error :  
“”

msg: Waited too long for ELB instances to be healthy. Wed Jul 22 19:56:37 2015

“”"

The health\_check\_period config doesn’t see to be related with this… How can I increase the timeout of this task ?

Regards,  
Nicolas.

---

<div class="post-metadata">

**Author:** ![Jon\_Hadfield](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@Jon\_Hadfield](https://forum.ansible.com/u/Jon_Hadfield)\
**Post date:** [July 22, 2015, 5:29pm UTC](https://forum.ansible.com/t/ec2-asg-timeout-issue/18824/2 "2015-07-22T17:29:55Z")

</div>

Have you tried specifying a wait\_timeout, i.e.:

- wait\_for\_instances  
Wait for the ASG instances to be in a ready state before  
exiting. If instances are behind an ELB, it will wait until  
the instances are considered by the ELB. [Default: True]

- wait\_timeout  
how long before wait instances to become viable when replaced.  
Used in concjunction with instance\_ids option. [Default: 300]

The 300 second default would explain the 5 minute failure.

---

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [July 22, 2015, 6:37pm UTC](https://forum.ansible.com/t/ec2-asg-timeout-issue/18824/3 "2015-07-22T18:37:43Z")

</div>

cheers somehow I didn’t noticed these 2 options, I’v set wait\_for\_instances to False.
