Getting ETIMEDOUT error in AWS Lambda function - javascript

I have configured VPC in my Lambda because I wanted to use AWS EFS and I get the following error when my lambda function tries to get data from third party application.
"Error: connect ETIMEDOUT 35.157.139.105:443 at
TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) "
Can someone please guide me what I'm missing here?

I had the same issue ,
the problem was with the VPC .
from AWS Troubleshoot networking issues in Lambda :
By default, Lambda runs your functions in an internal virtual private
cloud (VPC) with connectivity to AWS services and the internet. To
access local network resources, you can configure your function to
connect to a VPC in your account. When you use this feature, you
manage the function's internet access and network connectivity with
Amazon Virtual Private Cloud (Amazon VPC) resources.
I solved it by creating a VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway. Internet-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table , according to the AWS instructions here.
I built the VPC in cloudFormation using this yaml (from the AWS documention above) and connected the Lambda function to the new VPC, its subnets and security group.

Related

How to fix Error: SSL connect error when connecting to aws ec2 instance

I just created an EC2 instance for my web server and I run into this whenever i try connecting to it:
This site can’t provide a secure connection
18.170.25.198 sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
Just connect on http, it works for me
http://18.170.25.198:8001/api

How to trace run time console logs in ec2 instance

I use the AWS SSM send-command AWS-RunShellScript through the AWS command line interface to send commands to a number of EC2 instances. The command runs the JS script which will generate run-time console logs (JS); is there a way to view it in EC2?
You can use Amazon CloudWatch Logs to monitor, store, and access your
log files from Amazon Elastic Compute Cloud (Amazon EC2) instances. CloudWatch Logs enables
you to centralize the logs from all of your systems, applications, and
AWS services that you use, in a single, highly scalable service.
To install Cloudwatch agent and configure your cloudwatch agent, Kindly refer

routing error connecting from javascript lambda function to neo4j 4.4.x via vpc peering

We are in the process of upgrading our Neo4j database from 3.5.28 to 4.4.8 and we've encountered a problem we can't resolve.
Our current platform involves javascript lambda functions accessing a 3.5.28 cluster hosted in a separate VPC using the 1.7.2 javascript driver via a VPC peering connection. This has worked fine for many years.
Now that we're trying to upgrade to the 4.x driver (currently 4.4.6) and a 4.4.8 Neo4j cluster, with the same VPC peering setup, we're getting the following error:
Error registering acceptance of terms: Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1659054032636, routers=[], readers=[], writers=[]]
We are able to connect to the cluster from the browser app via a VPN gateway in the remote VPC and successfully retrieve the routing table, so it would appear that the cluster itself is working ok.
Has anyone else encountered this problem and hopefully resolved it?

How to ssh gcp private vm from local browser website?

I am trying to integrate different cloud platforms(aws, gcp…) on my frontend website.
gcp vm has no public ip, only internal ip.
Is there any way that ssh to gcp vm from my html website?
The official doc only has command line tutorial, but it's not what I want.
https://cloud.google.com/compute/docs/instances/connecting-advanced
What kind of gcp api does my backend server need to call, so that allow frontend ssh to gcp VM?
For this requirement, does the gcp api provide similar functionality?

Node.js on Azure Worker Role w/ SSL results in ERR_SSL_PROTOCOL_ERROR

I have a WorkerRole configured to start node.exe via the Runtime/EntryPoint/ProgramEntryPoint element in the csdef and have a HttpsIn EndPoint configured for https on port 443 w/ a valid certificate. I'm also setting the PORT environment variable in Runtime/Environment which is used by node to listen on for incoming requests.
When I start the service (either in local dev fabric or in Azure) and try to hit the service I get the following error:
SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
I have verified that node.exe is indeed started when the service starts, and if I look up the local port in the Compute Emulator, usually something like:
http://localhost:444
I am able to successfully hit node directly with that using my browser. I am also able to hit node through Azure when SSL is not configured.
What am I missing? Thanks!
The issue was that I was using the http module instead of the https module when starting the web server in Node. Works once I started the https server using the ssl certificate.
I was following a guide for SSL w/ Node in a WebRole, which requires a different set up than SSL w/ Node in WorkerRole.

Categories