
Explanation:
The correct answer is D. Here’s why:
The question asks for a solution to simplify the deployment of a serverless API and optimize code reuse using Amazon API Gateway and AWS Lambda. Option D suggests deploying the shared libraries, custom classes, and the code for Lambda functions into a Docker image. This Docker image is then uploaded to Amazon Elastic Container Registry (Amazon ECR). The Lambda functions are configured to use this Docker image as their deployment package.
Simplified Deployment:
Code Reuse:
Alignment with Modern Practices:
Using Docker images stored in Amazon ECR and configured within AWS Lambda combines the advantages of containerization (such as isolated environments, repeatable builds, and ease of dependency management) with the simplicity and scalability of AWS Lambda's serverless architecture.
Ultimate access to all questions.
No comments yet.
A company is developing a new serverless API by using Amazon API Gateway and AWS Lambda. The company integrated the Lambda functions with API Gateway to use several shared libraries and custom classes. A solutions architect needs to simplify the deployment of the solution and optimize for code reuse. Which solution will meet these requirements?
A
Deploy the shared libraries and custom classes into a Docker image. Store the image in an S3 bucket. Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
B
Deploy the shared libraries and custom classes to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
C
Deploy the shared libraries and custom classes to a Docker container in Amazon Elastic Container Service (Amazon ECS) by using the AWS Fargate launch type. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the deployed container as a Lambda layer.
D
Deploy the shared libraries, custom classes, and code for the API's Lambda functions to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Configure the API's Lambda functions to use the Docker image as the deployment package.