title: Connection timed out error in Lambda Function
body: <p>I am trying to SSH all the ec2 instances in AWS account through lambda function.</p>
  <p>c.connect( hostname = each_in.private_ip_address, username = 'pcs_user', pkey = k )</p>
  <p>But I'm getting an error like this. I have used AWSLambdaVPCAccessExecutionRole to IAM role.</p>
  <pre><code>Response:
  {
    &quot;errorMessage&quot;: &quot;[Errno 110] Connection timed out&quot;,
    &quot;errorType&quot;: &quot;TimeoutError&quot;,
    &quot;stackTrace&quot;: [
      &quot;  File \&quot;/var/task/lambda_function.py\&quot;, line 30, in lambda_handler\n    c.connect( hostname = each_in.private_ip_address, username = 'pcs_us', pkey = k )\n&quot;,
      &quot;  File \&quot;/opt/python/paramiko/client.py\&quot;, line 349, in connect\n    retry_on_signal(lambda: sock.connect(addr))\n&quot;,
      &quot;  File \&quot;/opt/python/paramiko/util.py\&quot;, line 283, in retry_on_signal\n    return function()\n&quot;,
      &quot;  File \&quot;/opt/python/paramiko/client.py\&quot;, line 349, in &lt;lambda&gt;\n    retry_on_signal(lambda: sock.connect(addr))\n&quot;
    ]
  }
  </code></pre>