AWS › Lambda & Serverless
What event sources can trigger a Lambda function to execute, and how does this support building event driven applications?
BeginnerAnswer
Lambda functions can be triggered by a wide variety of event sources, including an S3 object upload, a new message arriving in an SQS queue, an API Gateway request, a scheduled EventBridge rule, or a change captured in a DynamoDB stream, letting you build applications that react automatically to events as they occur throughout your AWS environment rather than needing a continuously running process to poll for changes.
aws lambda create-event-source-mapping --function-name process-orders --event-source-arn arn:aws:sqs:us-east-1:123456789012:orders-queueReal-world example An order processing system triggers a Lambda function automatically whenever a new message arrives in an SQS queue, processing each order the moment it is ready rather than running a continuously active server that repeatedly checks the queue for new work.