counter = 0
while counter < 70:
    time.sleep(1)
conn.close()
conn = boto.ec2.connection.EC2Connection(ec2auth.access_key, ec2auth.
    private_key)
startedinstance = conn.get_all_instances(instance_ids=str(newinstance.
    instances[0].id))[0]
counter = counter + 1
if str(startedinstance.instances[0].state) == 'running':
    break
if counter == 69:
    print('Timed out waiting for instance to start.')
print('Added: ' + startedinstance.instances[0].tags['Name'
    ] + ' ' + startedinstance.instances[0].public_dns_name)
Issues trying to SSH into a fresh EC2 instance with Paramiko