1. To be able to invoke Lambda via HTTP, need to setup a URL in API Gateway. The URL can then be invoked
  2. 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].
  3. 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.

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.