0
0
AWScloud~10 mins

Lambda with S3 event triggers in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the AWS service that triggers the Lambda function.

AWS
"Events": ["[1]"],
Drag options to blanks, or click blank then click option'
Aec2
Bdynamodb
Cs3:ObjectCreated:*
Dsns
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated service names like 'ec2' or 'sns' as event triggers.
Omitting the event type suffix like ':ObjectCreated:*'.
2fill in blank
medium

Complete the code to specify the S3 bucket name in the event source configuration.

AWS
"Bucket": "[1]",
Drag options to blanks, or click blank then click option'
Amy-lambda-bucket
Blambda-function
Cmy-ec2-instance
Dcloudwatch-logs
Attempts:
3 left
💡 Hint
Common Mistakes
Using the Lambda function name instead of the bucket name.
Using unrelated resource names like EC2 or CloudWatch.
3fill in blank
hard

Fix the error in the Lambda function handler declaration.

AWS
def [1](event, context):
Drag options to blanks, or click blank then click option'
Alambda_handler
Bmain
Chandle_event
Dprocess
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic function names like 'main' or 'process' without updating Lambda configuration.
Using names that do not match the handler setting.
4fill in blank
hard

Fill both blanks to correctly extract the bucket name and object key from the event.

AWS
bucket = event['Records'][0]['s3']['[1]']['[2]']
Drag options to blanks, or click blank then click option'
Abucket
Bname
Cobject
Dkey
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'object' or 'key' instead of 'bucket' and 'name' for bucket extraction.
Mixing up bucket and object keys.
5fill in blank
hard

Fill both blanks to correctly extract the object key from the event.

AWS
object_key = event['Records'][0]['s3']['[1]']['[2]']
Drag options to blanks, or click blank then click option'
Aobject
Bkey
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bucket' instead of 'object' for object key extraction.
Confusing 'name' with 'key' for the object.