AWS API Gateway vs. Application Load Balancer (ALB)
Tag: AWS lambda
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
Lambda Time Out
lambda time out best practices If you make an API call using an AWS SDK and the call fails, the AWS
AWS Lambda Functions
Documentation from serverless General Information By default, lambda execution time is up to 29 seconds invoked . In function settings,
Simple Async AWS Lambda Function Example
module.exports.handler = async event => { return event; } We want to ship this to an SQS queue onSuccess. give
DynamoDB Data Stream
Basic Functionality Deal with Failure dynamoDB->lambda->cloudwatch aws-dynamodb-stream-lambda github sample code new item->dynamoDB->dynamoDB stream->lambda->sns New items dynamoDB stream to lambda tutorial