Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I am trying to debug what appears to be a socket error in the node.js https library environment when running in the AWS Lambda environment (Node.js 4.3). This issue only occurs highly intermittently and only under heavy load. My team has been able to reproduce the issue consistently with a load test, and we would like to enable debug logging from the https module. 

I've found in the node documentation that I can enable debug logging by setting the NODE_DEBUG=https environment variable. Additionally, I don't have the ability to change the command line that Lambda uses to invoke my function.

Is there another way to create the same debug logging as setting NODE_DEBUG?

1 Answer

0 votes
by (44.4k points)

AWS Lambda support Environment variables. Check out this documentation for more details AWS Lambda Environment VariablesYou can mention Environment variables on both AWS console and AWS CLI. In AWS CLI, you can create a Lambda function with an LD_LIBRARY_PATH environment variable like this:

aws lambda create-function \

  --region us-east-1

  --function-name myTestFunction

  --zip-file fileb://path/package.zip

  --role role-arn

  --environment Variables={LD_LIBRARY_PATH=/usr/bin/test/lib64}

  --handler index.handler

  --runtime nodejs4.3

--profile default

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
asked Jan 18, 2020 in AWS by R. Raman (790 points)

Browse Categories

...