AWS Lambda | Using AWS Lambda to process AWS events Flashcards
Can I use my own version of a supported library?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
Yes. you can include your own copy of a library (including the AWS SDK) in order to use a different version than the default one provided by AWS Lambda.
What is an event source?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
An event source is an AWS service or developer-created application that produces events that trigger an AWS Lambda function to run. Some services publish these events to Lambda by invoking the cloud function directly (for example, Amazon S3). Lambda can also poll resources in other services that do not publish events to Lambda. For example, Lambda can pull records from a Kinesis stream and execute a Lambda function for each message in the stream.
Many other services, such as AWS CloudTrail, can act as event sources simply by logging to Amazon S3 and using S3 bucket notifications to trigger AWS Lambda functions.
What event sources can be used with AWS Lambda?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
Please see our documentation for a complete list of event sources.
How are events represented in AWS Lambda?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
Events are passed to a Lambda function as an event input parameter. For event sources where events arrive in batches, such as Amazon Kinesis and Amazon DynamoDB Streams, the event parameter may contain multiple events in a single call, based on the batch size you request.To learn more about Amazon S3 event notifications visit Configuring Notifications for Amazon S3 Events. To learn more about Amazon DynamoDB Streams visit the DynamoDB Stream Developers Guide. To learn more about invoking Lambda functions using Amazon SNS, visit the Amazon SNS Developers Guide. For more information on Amazon Cognito events, visit Amazon Cognito. For more information on AWS CloudTrail logs and auditing API calls across AWS services, see AWS CloudTrail.
How do I make an AWS Lambda function respond to changes in an Amazon S3 bucket?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
From the AWS Lambda console, you can select a function and associate it with notifications from an Amazon S3 bucket. Alternatively, you can use the Amazon S3 console and configure the bucket’s notifications to send to your AWS Lambda function. This same functionality is also available through the AWS SDK and CLI.
How do I make an AWS Lambda function respond to updates in an Amazon DynamoDB table?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
You can trigger a Lambda function on DynamoDB table updates by subscribing your Lambda function to the DynamoDB Stream associated with the table. You can associate a DynamoDB Stream with a Lambda function using the Amazon DynamoDB console, the AWS Lambda console or Lambda’s registerEventSource API.
How do I use an AWS Lambda function to process records in an Amazon Kinesis stream?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
From the AWS Lambda console, you can select a Lambda function and associate it with an Amazon Kinesis stream owned by the same account. This same functionality is also available through the AWS SDK and CLI.
How does AWS Lambda process data from Amazon Kinesis streams and Amazon DynamoDB Streams?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
The Amazon Kinesis and DynamoDB Streams records sent to your AWS Lambda function are strictly serialized, per shard. This means that if you put two records in the same shard, Lambda guarantees that your Lambda function will be successfully invoked with the first record before it is invoked with the second record. If the invocation for one record times out, is throttled, or encounters any other error, Lambda will retry until it succeeds (or the record reaches its 24-hour expiration) before moving on to the next record. The ordering of records across different shards is not guaranteed, and processing of each shard happens in parallel.
How do I use an AWS Lambda function to respond to notifications sent by Amazon Simple Notification Service (SNS)?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
From the AWS Lambda console, you can select a Lambda function and associate it with an Amazon SNS topic. This same functionality is also available through the AWS SDK and CLI.
How do I use an AWS Lambda function to respond to emails sent by Amazon Simple Email Service (SES)?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
From the Amazon SES Console, you can set up your receipt rule to have Amazon SES deliver your messages to an AWS Lambda function. The same functionality is available through the AWS SDK and CLI.
How do I use an AWS Lambda function to respond to Amazon CloudWatch alarms?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
First, configure the alarm to send Amazon SNS notifications. Then from the AWS Lambda console, select a Lambda function and associate it with that Amazon SNS topic. See the Amazon CloudWatch Developer Guide for more on setting up Amazon CloudWatch alarms.
How do I use an AWS Lambda function to respond to changes in user or device data managed by Amazon Cognito?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
From the AWS Lambda console, you can select a function to trigger when any datasets associated with an Amazon Cognito identity pool are synchronized. This same functionality is also available through the AWS SDK and CLI. Visit Amazon Cognito for more information on using Amazon Cognito to share and synchronize data across a user’s devices.
How can my application trigger an AWS Lambda function directly?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
You can invoke a Lambda function using a custom event through AWS Lambda’s invoke API. Only the function’s owner or another AWS account that the owner has granted permission can invoke the function. Visit the Lambda Developers Guide to learn more.
What is the latency of invoking an AWS Lambda function in response to an event?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
AWS Lambda is designed to process events within milliseconds. Latency will be higher immediately after a Lambda function is created, updated, or if it has not been used recently.
How do I create a mobile back-end using AWS Lambda?
Using AWS Lambda to process AWS events
AWS Lambda | Compute
You upload the code you want AWS Lambda to execute and then invoke it from your mobile app using the AWS Lambda SDK included in the AWS Mobile SDK. You can make both direct (synchronous) calls to retrieve or check data in real time as well as asynchronous calls. You can also define a custom API using Amazon API Gateway and invoke your Lambda functions through any REST compatible client. To learn more about the AWS Mobile SDK, visit the AWS Mobile SDK page. To learn more about Amazon API Gateway, visit the Amazon API Gateway page.