Here’s how to avoid lambda throttling when lambda concurrency is limited: The maximum concurrency setting limits the number of concurrent
Category: AWS
Securely Calling AWS Lambda from React
Use API Gateway Lambda authorizers A Lambda authorizer is useful if you want to implement a custom authorization scheme that
Keeping Lambda Warm
Reducing cold starts with Provisioned Concurrency Understanding how functions warmers work However, this is not a guaranteed way to reduce
Server side events
Event Source API An EventSource instance opens a persistent connection to an HTTP server, which sends events in text/event-stream format. The connection remains open until closed by calling EventSource.close().
Websocket
AWS serverless documentation Authorization Using API Gateway blog Iam Role Events handled by CreateSocket labmda: Connect Do Not Message the
Step Function and Cloudwatch Log
https://www.davehall.com.au/blog/2020/07/10/logging-step-functions-cloudwatch/ AWSTemplateFormatVersion: ‘2010-09-09’ Description: StepFunction with Logging Example. Parameters: Resources: StepFunctionExecRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: ‘2012-10-17’ Statement: – Effect:
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.
SQS subscribes to SNS topic
Resources: SNSTopic: Type: AWS::SNS::Topic Properties: TopicName: name KmsMasterKeyId: !ImportValue kms-key-id SQSQueue: Type: AWS::SQS::Queue SNSSubscription: Type: AWS::SNS::Subscription Properties: TopicArn: !Ref SNSTopicArn
Step function notes
Use step function to delay sns { “StartAt”: “Delay”, “Comment”: “Publish to SNS with delay”, “States”: { “Delay”: { “Type”:
Lambda inserting into SQS using message timer
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#sendMessage-property const AWS = require(‘aws-sdk’); exports.handler = async (event, context) => { // Get the SQS client. const sqs =