send https from AWS lambda to AWS elastic beanstalk servers
<p>I am struggling to enable an AWS lambda to send HTTPS POST requests to an AWS elastic beanstalk service.
The elastic beanstalk provides web and web services and works nicely.
The lambda is doing some calculations with AWS elasticache (works well) and then decides if to send HTTPS POST to the beanstalk URL.</p>

<p>The lambda is written with <code>node.js</code>. About 2 minutes after the POST attempt I am getting this timeout: </p>

<pre><code>[Error: connect ETIMEDOUT X.Y.Z.W:443] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect', address: 'X.Y.Z.W', port: 443 
</code></pre>

<p>I see no indication of a request in the elastic bean nginx access log. </p>

<p>So my understanding is that the security groups are not set correctly.</p>

<p>I ruled out the option that the elastic beanstalk prevents such connections - The lambda is using a url with an external domain name that can be used from any browser and that works fine.</p>

<p>So I am left with the conclusion that the lambda security prevents this connection. So - I opened up the lambda security group completely to "All traffic" from anywhere - and I still get this problem.</p>

<p>Any ideas?</p>