AWS Certified Data Engineer – Associate (DEA-C01) — Question 8
A company loads transaction data for each day into Amazon Redshift tables at the end of each day. The company wants to have the ability to track which tables have been loaded and which tables still need to be loaded.
A data engineer wants to store the load statuses of Redshift tables in an Amazon DynamoDB table. The data engineer creates an AWS Lambda function to publish the details of the load statuses to DynamoDB.
How should the data engineer invoke the Lambda function to write load statuses to the DynamoDB table?
Answer options
- A. Use a second Lambda function to invoke the first Lambda function based on Amazon CloudWatch events.
- B. Use the Amazon Redshift Data API to publish an event to Amazon EventBridge. Configure an EventBridge rule to invoke the Lambda function.
- C. Use the Amazon Redshift Data API to publish a message to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the SQS queue to invoke the Lambda function.
- D. Use a second Lambda function to invoke the first Lambda function based on AWS CloudTrail events.
Correct answer: B
Explanation
The correct answer is B because it allows the data engineer to use the Amazon Redshift Data API to publish an event to EventBridge, which can then invoke the Lambda function. Option A incorrectly suggests using CloudWatch events, which is not the best practice for this scenario. Option C suggests using SQS, which is less direct than using EventBridge for triggering the Lambda based on events. Option D incorrectly relies on CloudTrail events, which are not designed for this type of invocation.