MCQs on AWS Lambda Triggers and Events | AWS Lambda Multiple Choice Questions

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)

  1. 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
  2. Which of the following AWS services can trigger a Lambda function?
    a) Amazon EC2
    b) Amazon RDS
    c) Amazon S3
    d) AWS CloudTrail
  3. Lambda functions are triggered by:
    a) CloudWatch alarms only
    b) Events from AWS services
    c) Manual API calls
    d) Lambda layers
  4. 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
  5. 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
  6. What event type from DynamoDB triggers an AWS Lambda function?
    a) Data change (Insert, Modify, Delete)
    b) Table creation
    c) Backups
    d) Data upload
  7. 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
  8. 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
  9. 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
  10. 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)

  1. Which S3 event type can trigger an AWS Lambda function?
    a) Object created
    b) Object deleted
    c) Object restored
    d) All of the above
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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)

  1. 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
  2. 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:*
  3. 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
  4. 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
  5. 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)

  1. 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
  2. What HTTP method in API Gateway is used to trigger a Lambda function?
    a) POST
    b) GET
    c) PUT
    d) All of the above
  3. 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
  4. 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
  5. 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

QnoAnswer
1b) To trigger code execution in response to events
2c) Amazon S3
3b) Events from AWS services
4b) S3 PUT events
5a) A Lambda execution role
6a) Data change (Insert, Modify, Delete)
7b) A service that produces events
8c) AWS SNS
9a) Event filtering
10a) AWS Step Functions
11d) All of the above
12a) It triggers a Lambda function execution
13a) S3 event notification
14a) Amazon SNS
15b) Lambda SNS trigger
16b) Through an S3 event notification
17b) Stream-based events
18a) Yes, using a custom resource
19a) Create an SNS topic and subscribe the Lambda function
20d) All of the above
21b) Set the event notification in the S3 bucket properties
22b) s3:ObjectRemoved:*
23b) Assign an IAM role to the Lambda function
24a) Lambda execution role
25a) Execution of custom logic based on event data
26a) Set up a REST API in API Gateway and connect it to Lambda
27d) All of the above
28b) API Gateway Lambda proxy integration
29a) Lambda permissions for API Gateway
30a) As JSON-formatted HTTP request body

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top