Q12 — AWS DEA-C01 Ch.1
Question 12 of 100 | ← Chapter 1
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?
- 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. Use the Amazon Redshift Data API to publish an event to Amazon EventBridge. Configure an EventBridge rule to invoke the Lambda function.
Explanation
考虑到公司希望在AmazonRedshift表加载数据后跟踪哪些表已加载和哪些表仍需加载,数据工程师需要将加载状态存储到AmazonDynamoDB表中。为此,数据工程师创建了一个AWSLambda函数来发布加载状态详细信息到DynamoDB。为了触发这个Lambda函数,一个有效的方法是使用AmazonRedshiftDataAPI将事件发布到AmazonEventBridge,然后配置EventBridge规则来调用Lambda函数。这种方式可以直接在数据加载到Redshift之后触发事件,进而更新DynamoDB中的状态,无需额外的轮询或延迟。因此,选项B是正确的答案。