Q25 — AWS DEA-C01 Ch.1
Question 25 of 100 | ← Chapter 1
A company has a frontend ReactJS website that uses Amazon API Gateway to invoke REST APIs. The APIs perform the functionality of the Website. A data engineer needs to write a Python script that can be occasionally invoked through API Gateway. The code must return results To API Gateway. Which solution will meet these requirements with the LEAST operational overhead?
- A. Deploy a custom Python script on an Amazon Elastic Container Service (Amazon ECS) cluster.
- B. Create an AWS Lambda Python function with provisioned concurrency. ✓
- C. Deploy a custom Python script that can integrate with API Gateway on Amazon Elastic Kubernetes Service (Amazon EKS).
- D. Create an AWS Lambda function. Ensure that the function is warm by scheduling an Amazon EventBridge rule to invoke the Lambda Function every 5 minutes by using mock events.
Correct Answer: B. Create an AWS Lambda Python function with provisioned concurrency.
Explanation
对于这个问题,目标是寻找一个能够通过APIGateway被调用并返回结果的Python脚本解决方案,同时保持最小的操作开销。A选项部署在AmazonECS上的自定义Python脚本需要管理容器集群,这增加了运维复杂性。B选项创建具有预置并发性的AWSLambdaPython函数是一个轻量级解决方案,能够按需快速启动并处理请求,减少了不必要的资源开销和运维工作。C选项在AmazonEKS上部署自定义Python脚本同样需要管理Kubernetes集群,操作复杂且成本较高。D选项虽然使用了Lambda,但通过EventBridge定期调用以保持函数预热会增加不必要的调用成本,因为每次调用都会产生费用,即使使用的是mock事件。因此,B选项是满足要求且操作开销最小的解决方案。