SAP-C02 学习助手

SAP-C02 第 68 题

Lambda S3 EC2 SQS CloudWatch Config ECS Fargate Auto Scaling

题目

A company runs a Python script on an Amazon EC2 instance to process data. The script runs every 10 minutes. The script ingests files from an Amazon S3 bucket and processes the files. On average, the script takes approximately 5 minutes to process each file The script will not reprocess a file that the script has already processed. The company reviewed Amazon CloudWatch metrics and noticed that the EC2 instance is idle for approximately 40% of the time because of the file processing speed. The company wants to make the workload highly available and scalable. The company also wants to reduce long-term management overhead. Which solution will meet these requirements MOST cost-effectively?

中文翻译:
一家公司在 Amazon EC2 实例上运行 Python 脚本来处理数据。该脚本每 10 分钟运行一次。该脚本从 Amazon S3 存储桶提取文件并处理这些文件。平均而言,该脚本大约需要 5 分钟来处理每个文件。该脚本不会重新处理该脚本已经处理过的文件。该公司查看了 Amazon CloudWatch 指标并注意到,由于文件处理速度的原因,EC2 实例大约有 40% 的时间处于空闲状态。该公司希望使工作负载具有高可用性和可扩展性。该公司还希望减少长期管理费用。哪种解决方案能够最具成本效益地满足这些要求?

选项

A. Migrate the data processing script to an AWS Lambda function. Use an S3 event notification to invoke the Lambda function to process the objects when the company uploads the objects.

中文翻译:
将数据处理脚本迁移到 AWS Lambda 函数。公司上传对象时,使用S3事件通知调用Lambda函数处理对象。

B. Create an Amazon Simple Queue Service (Amazon SQS) queue. Configure Amazon S3 to send event notifications to the SQS queue. Create an EC2 Auto Scaling group with a minimum size of one instance. Update the data processing script to poll the SQS queue. Process the S3 objects that the SQS message identifies.

中文翻译:
创建 Amazon Simple Queue Service (Amazon SQS) 队列。配置 Amazon S3 以将事件通知发送到 SQS 队列。创建一个最小大小为 1 个实例的 EC2 Auto Scaling 组。更新数据处理脚本以轮询 SQS 队列。处理SQS消息标识的S3对象。

C. Migrate the data processing script to a container image. Run the data processing container on an EC2 instance. Configure the container to poll the S3 bucket for new objects and to process the resulting objects.

中文翻译:
将数据处理脚本迁移到容器镜像。在 EC2 实例上运行数据处理容器。配置容器以轮询 S3 存储桶以查找新对象并处理生成的对象。

D. Migrate the data processing script to a container image that runs on Amazon Elastic Container Service (Amazon ECS) on AWS Fargate. Create an AWS Lambda function that calls the Fargate RunTaskAPI operation when the container processes the file. Use an S3 event notification to invoke the Lambda function.

中文翻译:
将数据处理脚本迁移到在 AWS Fargate 上的 Amazon Elastic Container Service (Amazon ECS) 上运行的容器映像。创建一个 AWS Lambda 函数,该函数在容器处理文件时调用 Fargate RunTaskAPI 操作。使用 S3 事件通知调用 Lambda 函数。

答案

A

解析

正确答案:A 解析: 本题应选择 A。 正确选项: A. 将数据处理脚本迁移到 AWS Lambda 函数。公司上传对象时,使用S3事件通知调用Lambda函数处理对象。 选择理由: 该选项最直接地满足题干中的关键约束。做 SAP-C02 题目时,需要同时对照题干里的限定词,例如最高性能、最低运维开销、成本效益、可靠性、可扩展性、安全性、RTO/RPO、合规要求等。本题相关考点主要包括:Lambda、S3、EC2、SQS、CloudWa...

登录后查看完整解析