Which solution will meet these requirements?
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.
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.
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.
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.
Explanations:
While creating an ECS cluster with Fargate tasks is a valid approach, using EventBridge to start Fargate tasks based on EFS file uploads is not supported. EFS does not directly trigger EventBridge events. Therefore, this option does not fulfill the requirement of triggering processing tasks when files are added.
This option suggests using an EFS event notification to invoke a Fargate service. However, EFS does not support event notifications for file uploads. Therefore, it cannot trigger the processing based on new file uploads, making this approach incorrect.
This option refactors the application by using an AWS Lambda function to extract the container selection logic and migrating file storage to Amazon S3. S3 event notifications can directly trigger the Lambda function when new files are uploaded, allowing for an efficient and serverless architecture that meets the requirements.
This option proposes using Lambda container images for processing and a decision Lambda function to invoke the appropriate processing function. However, like the other options, it requires migrating to S3 and configuring an S3 event notification. While using Lambda functions is valid, the need for separate decision logic makes it less streamlined compared to option C.