Push Model Event Sources - Serverless Architectures with AWS Lambda

Push Model Event Sources

Amazon S3

Invocation Model Push
Invocation Type Event
Description S3 event notifications (such as ObjectCreated and ObjectRemoved) can be configured to invoke a Lambda function as they are published.
Example Use Cases

Create image modifications (thumbnails, different resolutions, watermarks, etc.) for images that users upload to an S3 bucket through your application.

Process raw data uploaded to an S3 bucket and move transformed data to another S3 bucket as part of a big data pipeline.

Amazon API Gateway

Invocation Model Push
Invocation Type Event or RequestResponse
Description

The API methods you create with API Gateway can use a Lambda function as their service backend. If you choose Lambda as the integration type for an API method, your Lambda function is invoked synchronously (the response of your Lambda function serves as the API response). With this integration type, API Gateway can also act as a simple proxy to a Lambda function. API Gateway will perform no processing or transformation on its own and will pass along all the contents of the request to Lambda.

If you want an API to invoke your function asynchronously as an event and return immediately with an empty response, you can use API Gateway as an AWS Service Proxy and integrate with the Lambda Invoke API, providing the Event InvocationType in the request header. This is a great option if your API clients don’t need any information back from the request and you want the fastest response time possible. (This option is great for pushing user interactions on a website or app to a service backend for analysis.)

Example Use Cases

Web service backends (web application, mobile app, microservice architectures, etc.)

Legacy service integration (a Lambda function to transform a legacy SOAP backend into a new modern REST API).

Any other use cases where HTTPS is the appropriate integration mechanism between application components.

Amazon SNS

Invocation Model Push
Invocation Type Event
Description Messages that are published to an SNS topic can be delivered as events to a Lambda function.
Example Use Cases

Automated responses to CloudWatch alarms.

Processing of events from other services (AWS or otherwise) that can natively publish to SNS topics.

AWS CloudFormation

Invocation Model Push
Invocation Type RequestResponse
Description As part of deploying AWS CloudFormation stacks, you can specify a Lambda function as a custom resource to execute any custom commands and provide data back to the ongoing stack creation.
Example Use Cases

Extend AWS CloudFormation capabilities to include AWS service features not yet natively supported by AWS CloudFormation.

Perform custom validation or reporting at key stages of the stack creation/update/delete process.

Amazon CloudWatch Events

Invocation Model Push
Invocation Type Event
Description Many AWS services publish resource state changes to CloudWatch Events. Those events can then be filtered and routed to a Lambda function for automated responses.
Example Use Cases

Event-driven operations automation (for example, take action each time a new EC2 instance is launched, notify an appropriate mailing list when AWS Trusted Advisor reports a new status change).

Replacement for tasks previously accomplished with cron (CloudWatch Events supports scheduled events).

Amazon Alexa

Invocation Model Push
Invocation Type RequestResponse
Description You can write Lambda functions that act as the service backend for Amazon Alexa Skills. When an Alexa user interacts with your skill, Alexa’s Natural Language Understand and Processing capabilities will deliver their interactions to your Lambda functions.
Example Use Cases An Alexa skill of your own.