Tutorial video npm init npm -i –save (libraries) open in code, create handler function in index.js zip -r deploy.zip ./
Tag: AWS lambda
Cloudformation issues encountered
The event source and function provided mapping already exists. Please update or delete the existing mapping with UUID Add an
Lambda layer
AWS blank nodejs lambda lambda layer documentation A Lambda layer is a .zip file archive that contains supplementary code or
Lambda and SQS
Here’s how to avoid lambda throttling when lambda concurrency is limited: The maximum concurrency setting limits the number of concurrent
Keeping Lambda Warm
Reducing cold starts with Provisioned Concurrency Understanding how functions warmers work However, this is not a guaranteed way to reduce
Lambda Cache
https://katiyarvipinknp.medium.com/how-to-cache-the-data-in-aws-lambda-function-using-node-js-use-tmp-storage-of-aws-lambda-2c7e1e01d923 const cachedItem = {}; // as you know, anything declared outside the event handler function is reused between invocations.
Lambda invoke step function nodejs example
const AWS = require(‘aws-sdk’); exports.handler = async (event, context) => { // Get the Step Functions client. const stepFunctions =
AWS Lambda Retry
Use AWS::Lambda::EventInvokeConfig to limit retries Example: Resources: function: Type: AWS::Lambda::Function Properties: Handler: index.handler Role: arn:aws:iam::123456789012:role/lambda-role Code: ZipFile: | exports.handler =
AWS Cloudwatch Alarm
For Lambda: MyNewAlarm: Type: AWS::CloudWatch::Alarm Properties: AlarmName: “AlarmNameGoesHere” AlarmDescription: “Alarm if lambda errors out too many times” Namespace: “AWS/Lambda” MetricName:
Step Function and lambda
Avoid reaching history quota Tutorial for creating lambda and step function that invokes it Invoke syntax, parameter and payload Supported