Better Living Through Narratology

CloudFormation cfn-init unable to connect

I was having trouble getting a Windows CloudFormation stack that leveraged CloudFormation::Init (cfn-init) to work properly.  All I found in the cfn-init.log file was a repeating error that looked like this:

Traceback (most recent call last):
File “cfnbootstrap\util.pyc”, line 159, in _retry
File “cfnbootstrap\util.pyc”, line 231, in _timeout
ConnectionError: (‘Connection aborted.’, error(10060, ‘A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond’))
2016-03-24 20:13:40,355 [DEBUG] Sleeping for 0.873665 seconds before retrying

I ran through some google searches but came back with surprising few hits on this error.  Everything regarding the syntax of the stack was clean.  It passed all checks, came back as valid, etc..  But I got this error every time I deployed the stack.  The culprit?  Internet connectivity.  The stack referenced a file to download and was unable to do so thanks to some strict Network ACLs.  I had seen this issue once before when a NAT instance in the VPC was stopped.  The lesson: check your internet connectivity when dealing with this error.

Posted in AWS, CloudFormation | No Comments