SAP-C02 第 511 题
题目
A company hosts a data-processing application on Amazon EC2 instances. The application polls an Amazon Elastic File System (Amazon EFS) file system for newly uploaded files. When a new file is detected, the application extracts data from the file and runs logic to select a Docker container image to process the file. The application starts the appropriate container image and passes the file location as a parameter. The data processing that the container performs can take up to 2 hours. When the processing is complete, the code that runs inside the container writes the file back to Amazon EFS and exits. The company needs to refactor the application to eliminate the EC2 instances that are running the containers. Which solution will meet these requirements?
中文翻译:
一家公司在 Amazon EC2 实例上托管数据处理应用程序。该应用程序轮询 Amazon Elastic File System (Amazon EFS) 文件系统以查找新上传的文件。当检测到新文件时,应用程序从文件中提取数据并运行逻辑来选择 Docker 容器映像来处理该文件。应用程序启动适当的容器映像并将文件位置作为参数传递。容器执行的数据处理最多可能需要 2 小时。处理完成后,容器内运行的代码会将文件写回 Amazon EFS 并退出。该公司需要重构应用程序以消除运行容器的 EC2 实例。哪种解决方案可以满足这些要求?
选项
A. Create an Amazon Elastic Container Service (Amazon ECS) cluster. Configure the processing to run as AWS Fargate tasks. Extract the container selection logic to run as an Amazon EventBridge rule that starts the appropriate Fargate task. Configure the EventBridge rule to run when files are added to the EFS file system.
中文翻译:
创建 Amazon Elastic Container Service (Amazon ECS) 集群。将处理配置为作为 AWS Fargate 任务运行。提取容器选择逻辑以作为启动适当的 Fargate 任务的 Amazon EventBridge 规则运行。配置将文件添加到 EFS 文件系统时运行的 EventBridge 规则。
B. Create an Amazon Elastic Container Service (Amazon ECS) cluster. Configure the processing to run as AWS Fargate tasks. Update and containerize the container selection logic to run as a Fargate service that starts the appropriate Fargate task. Configure an EFS event notification to invoke the Fargate service when files are added to the EFS file system.
中文翻译:
创建 Amazon Elastic Container Service (Amazon ECS) 集群。将处理配置为作为 AWS Fargate 任务运行。更新并容器化容器选择逻辑,以作为启动适当 Fargate 任务的 Fargate 服务运行。配置 EFS 事件通知以在文件添加到 EFS 文件系统时调用 Fargate 服务。
C. Create an Amazon Elastic Container Service (Amazon ECS) cluster. Configure the processing to run as AWS Fargate tasks. Extract the container selection logic to run as an AWS Lambda function that starts the appropriate Fargate task. Migrate the storage of file uploads to an Amazon S3 bucket. Update the processing code to use Amazon S3. Configure an S3 event notification to invoke the Lambda function when objects are created.
中文翻译:
创建 Amazon Elastic Container Service (Amazon ECS) 集群。将处理配置为作为 AWS Fargate 任务运行。提取容器选择逻辑以作为启动适当的 Fargate 任务的 AWS Lambda 函数运行。将文件上传的存储迁移到 Amazon S3 存储桶。更新处理代码以使用 Amazon S3。配置 S3 事件通知以在创建对象时调用 Lambda 函数。
D. Create AWS Lambda container images for the processing. Configure Lambda functions to use the container images. Extract the container selection logic to run as a decision Lambda function that invokes the appropriate Lambda processing function. Migrate the storage of file uploads to an Amazon S3 bucket. Update the processing code to use Amazon S3. Configure an S3 event notification to invoke the decision Lambda function when objects are created.
中文翻译:
创建 AWS Lambda 容器映像以进行处理。配置 Lambda 函数以使用容器映像。提取容器选择逻辑以作为调用适当 Lambda 处理函数的决策 Lambda 函数运行。将文件上传的存储迁移到 Amazon S3 存储桶。更新处理代码以使用 Amazon S3。配置 S3 事件通知以在创建对象时调用决策 Lambda 函数。
答案
C
解析
正确答案:C 解析: 本题应选择 C。 正确选项: C. 创建 Amazon Elastic Container Service (Amazon ECS) 集群。将处理配置为作为 AWS Fargate 任务运行。提取容器选择逻辑以作为启动适当的 Fargate 任务的 AWS Lambda 函数运行。将文件上传的存储迁移到 Amazon S3 存储桶。更新处理代码以使用 Amazon S3。配置 S3 事件通知以在创建对象时调用 La...