Lambda troubleshooting Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/tag/lambda-troubleshooting/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Sat, 18 Aug 2018 01:11:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://www.anujvarma.com/wp-content/uploads/anujtech.png Lambda troubleshooting Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/tag/lambda-troubleshooting/ 32 32 AWS Lambda Quick REcap https://www.anujvarma.com/aws-lambda-quick-recap/ https://www.anujvarma.com/aws-lambda-quick-recap/#respond Wed, 10 Jan 2018 01:09:00 +0000 http://www.anujvarma.com/?p=5409 To be able to invoke Lambda via HTTP, need to setup a URL in API Gateway. The URL can then be invoked logging module to write message to the logs, […]

The post AWS Lambda Quick REcap appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
  • To be able to invoke Lambda via HTTP, need to setup a URL in API Gateway. The URL can then be invoked
  • logging module to write message to the logs, you also get some additional information in the log such as the time stamp and the log levels. The log level identifies the type of log, such as [INFO], [ERROR], and [DEBUG].
  • You can also find these logs in CloudWatch.

    List all LAmbdas on your account

    1. In order to solve this problem, Epsagon has created an open-source project: list-lambdas. It’s a Python script which enumerates your Lambda functions across all AWS regions and provides useful information, such as the function’s memory settings, its

    Use Cases

    1. Monitor an HTTPS Endpoint (using Lambda and Cloudwatch).
    2. Step 1 –> Create ROLE (programmatic Identity) –> IN creating ROLE, add ‘Create Policy –> CloudWatch—> PutMetricData from the Write Permissions
    3. To run this periodically, create a Cloudwatch Rule –> Now that the Lambda script has been set up, you only need to make sure it gets run every five minutes (or any other interval you prefer). This is possible with CloudWatch Rules. Go to the CloudWatch service from your AWS dashboard and select “Rules” from the left-hand menu. Click on “Create rule” and select “Schedule” as yo

     

    To Prevent DDOS attack

    • Enable AWS Shield Standard – place Lambda on CloudFront – Anything behind Shield gets protected from DDOS;
    • Alternatively, host the URL in API Gateway and throttle the gateway as needed

    Event Loops Lambda

    The default behavior is that Lambda will wait for all scheduled work (work queued up in the event loop) to complete before allowing the next request to get called in a particular instance. In the case of our code that means Lambda will wait for the final saveImage() callback to fire before allowing another request through. However, it could be that the work we’re still performing is fine to run at the same time as the normal request handler. Luckily, we can override this behavior by changing the context.callbackWaitsForEmptyEventLoop flag, which has a default value of true, to false.

    The post AWS Lambda Quick REcap appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

    ]]>
    https://www.anujvarma.com/aws-lambda-quick-recap/feed/ 0