AWS Certified Solutions Architect – Professional (SAP-C02) — Question 505

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?

Answer options

Correct answer: C

Explanation

Option C is correct because AWS Fargate tasks can run for up to several hours, satisfying the 2-hour processing requirement, whereas AWS Lambda has a maximum execution limit of 15 minutes (ruling out Option D). Additionally, Amazon EFS does not native support event notifications to trigger Lambda or EventBridge directly upon file creation (ruling out Options A and B). Migrating the files to Amazon S3 allows the use of S3 Event Notifications to invoke an AWS Lambda function, which can programmatically launch the correct AWS Fargate task.