Which solution will meet these requirements?
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.
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.
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.
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.
Explanations:
Lambda layers do not support using Docker images as the source. Lambda layers are intended to contain libraries or function code packaged in ZIP files, not Docker images.
Similar to option A, Lambda layers cannot use Docker images from Amazon ECR as the source. Layers are restricted to ZIP files or Amazon S3 objects, not Docker images.
AWS Lambda layers cannot directly use containers from Amazon ECS or Fargate. Lambda layers are designed for code and dependencies packaged as ZIP files, not running containers.
AWS Lambda now supports deploying functions using container images stored in Amazon ECR. This allows for easier code reuse and simplifies deployment, making this the correct option.