AWS Lambda is a powerful serverless compute service that lets you run code without provisioning or managing servers. In this set of AWS Lambda MCQ questions and answers, we cover essential topics like Lambda triggers, working with AWS services, S3 bucket events, API Gateway triggers, and event filtering. These questions will help you enhance your skills and prepare for exams or practical use of AWS Lambda.
Understanding Lambda Triggers (10 MCQs)
What is the primary purpose of an AWS Lambda trigger? a) To initiate AWS CloudFormation stacks b) To trigger code execution in response to events c) To provision compute resources d) To store event data
Which of the following AWS services can trigger a Lambda function? a) Amazon EC2 b) Amazon RDS c) Amazon S3 d) AWS CloudTrail
Lambda functions are triggered by: a) CloudWatch alarms only b) Events from AWS services c) Manual API calls d) Lambda layers
Which event source automatically triggers an AWS Lambda function on object creation in S3? a) AWS CloudWatch b) S3 PUT events c) AWS SNS d) AWS DynamoDB Streams
Which of the following is required to use AWS Lambda with an event source? a) A Lambda execution role b) AWS Direct Connect c) CloudFormation template d) S3 lifecycle policy
What event type from DynamoDB triggers an AWS Lambda function? a) Data change (Insert, Modify, Delete) b) Table creation c) Backups d) Data upload
In the context of AWS Lambda, what is an event source? a) A function to process events b) A service that produces events c) A storage system for events d) A Lambda execution environment
Which of the following AWS services can be an event source for Lambda functions? a) AWS CloudTrail b) AWS Glue c) AWS SNS d) AWS S3 only
What can be configured as a trigger for a Lambda function from an event source? a) Event filtering b) Manual start c) Lambda function versioning d) S3 bucket encryption
Which AWS service is used to create event-based workflows that trigger Lambda functions? a) AWS Step Functions b) AWS CloudWatch c) AWS EC2 d) AWS Direct Connect
Working with AWS Services as Event Sources (S3, DynamoDB, SNS, etc.) (10 MCQs)
Which S3 event type can trigger an AWS Lambda function? a) Object created b) Object deleted c) Object restored d) All of the above
When using DynamoDB Streams as an event source, what happens when an item is added to a table? a) It triggers a Lambda function execution b) The item is automatically deleted c) A CloudWatch alarm is raised d) The stream is paused
What must you configure for an S3 bucket to trigger a Lambda function on object upload? a) S3 event notification b) Lambda permissions c) API Gateway configuration d) CloudWatch logs
Which AWS service provides a publish-subscribe model that can trigger Lambda functions? a) Amazon SNS b) Amazon EC2 c) AWS IAM d) AWS CloudFormation
What can be used to invoke a Lambda function in response to a new SNS message? a) AWS CloudWatch alarms b) Lambda SNS trigger c) AWS S3 events d) AWS Direct Connect
How can AWS Lambda access S3 objects in response to a trigger? a) Using a direct API call from Lambda b) Through an S3 event notification c) Using a custom IAM role d) Through an API Gateway endpoint
What is the most common event source for Lambda functions in DynamoDB? a) Table scan b) Stream-based events c) Item update notifications d) Backup notifications
Can a Lambda function be triggered by an event from AWS CloudFormation? a) Yes, using a custom resource b) No, CloudFormation cannot trigger Lambda c) Yes, but only for stack creation d) Yes, but only for stack deletion
How do you configure SNS to trigger a Lambda function? a) Create an SNS topic and subscribe the Lambda function b) Enable CloudWatch alarms c) Configure an S3 bucket notification d) Use DynamoDB streams
What is required for a Lambda function to be triggered by DynamoDB? a) A DynamoDB stream b) A Lambda execution role with access to DynamoDB c) A DynamoDB table with at least one item d) All of the above
Creating S3 Bucket Event Triggers for Lambda (5 MCQs)
How do you set up an S3 bucket event notification to trigger a Lambda function? a) Configure a trigger in the Lambda console b) Set the event notification in the S3 bucket properties c) Use AWS CLI to create the event trigger d) Use AWS SNS as an intermediary
Which S3 event type can be used to trigger Lambda functions on object deletion? a) s3:ObjectCreated:* b) s3:ObjectRemoved:* c) s3:ObjectRestored:* d) s3:ObjectDownloaded:*
How can you grant S3 permission to invoke a Lambda function? a) Use an S3 bucket policy b) Assign an IAM role to the Lambda function c) Set up an S3 lifecycle rule d) Create a custom CloudWatch rule
Which of the following must be configured to enable Lambda to process an event from an S3 bucket? a) Lambda execution role b) CloudWatch Logs c) EC2 instance permissions d) VPC configuration
What does an S3 event notification trigger in a Lambda function? a) Execution of custom logic based on event data b) S3 data encryption c) S3 object versioning d) Upload of a new object to S3
Setting up API Gateway to Trigger Lambda Functions (5 MCQs)
How can you use API Gateway to trigger Lambda functions? a) Set up a REST API in API Gateway and connect it to Lambda b) Configure a VPC endpoint for Lambda c) Create a direct invocation rule in CloudWatch d) Use SNS to send HTTP requests to Lambda
What HTTP method in API Gateway is used to trigger a Lambda function? a) POST b) GET c) PUT d) All of the above
Which feature in API Gateway allows you to trigger Lambda functions with a RESTful API? a) Resource methods b) API Gateway Lambda proxy integration c) CloudWatch integration d) AWS SQS integration
What is required to set up API Gateway to trigger Lambda functions? a) Lambda permissions for API Gateway b) API Gateway IAM role c) An S3 bucket d) A VPC with API Gateway access
How does API Gateway pass event data to a Lambda function? a) As JSON-formatted HTTP request body b) As an S3 object c) As a DynamoDB stream record d) As a direct EC2 call
Answers
Qno
Answer
1
b) To trigger code execution in response to events
2
c) Amazon S3
3
b) Events from AWS services
4
b) S3 PUT events
5
a) A Lambda execution role
6
a) Data change (Insert, Modify, Delete)
7
b) A service that produces events
8
c) AWS SNS
9
a) Event filtering
10
a) AWS Step Functions
11
d) All of the above
12
a) It triggers a Lambda function execution
13
a) S3 event notification
14
a) Amazon SNS
15
b) Lambda SNS trigger
16
b) Through an S3 event notification
17
b) Stream-based events
18
a) Yes, using a custom resource
19
a) Create an SNS topic and subscribe the Lambda function
20
d) All of the above
21
b) Set the event notification in the S3 bucket properties
22
b) s3:ObjectRemoved:*
23
b) Assign an IAM role to the Lambda function
24
a) Lambda execution role
25
a) Execution of custom logic based on event data
26
a) Set up a REST API in API Gateway and connect it to Lambda