Complete the code to specify the AWS service that triggers the Lambda function.
Event source for Lambda is [1].
S3 is a common event source that triggers Lambda functions when objects are created or deleted.
Complete the code to specify the event type that triggers Lambda on S3.
Lambda triggers on S3 event type: [1].The 'ObjectCreated' event triggers Lambda when a new object is added to an S3 bucket.
Fix the error in the event source mapping code for Lambda trigger.
Event source mapping: {
"EventSourceArn": "arn:aws:sqs:us-east-1:123456789012:MyQueue",
"FunctionName": "MyLambdaFunction",
"[1]": true
}The correct property to enable the event source mapping is 'Enabled'.
Fill both blanks to configure a CloudWatch event rule to trigger Lambda every 5 minutes.
Rule = {
"ScheduleExpression": "[1]",
"Targets": [{"Arn": "arn:aws:lambda:us-east-1:123456789012:function:MyFunction", "Id": "[2]"}]
}The schedule expression 'rate(5 minutes)' triggers every 5 minutes. The target Id is a unique name like 'MyLambdaTarget'.
Fill all three blanks to create an S3 event notification that triggers Lambda on object deletion.
{
"LambdaFunctionConfigurations": [
{
"LambdaFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MyFunction",
"Events": ["[1]"],
"Filter": {
"Key": {
"FilterRules": [
{"Name": "[2]", "Value": "[3]"}
]
}
}
}
]
}The event 's3:ObjectRemoved:*' triggers on object deletion. The filter rule uses 'prefix' and 'suffix' to specify object key filtering.