Q3 — AWS DOP-C02 Ch.1

Question 3 of 100 | ← Chapter 1

A company operates a file retrieval application that saves files to a database running on Amazon EC2 instances. Regulatory requirements mandate that the company delete files daily from specific EC2 instances. The company also retains database records for no more than 60 days. Database record deletion occurs after file deletion. The company has created a script to delete both files and database records. If the deletion script fails, the company must receive an email notification.

Correct Answer: A. Use AWS Systems Manager State Manager to automatically invoke a Systems Manager Automation document at a scheduled time each day. Configure the Automation document to run the deletion script sequentially using Run Command. Create an Amazon EventBridge rule to send failure notifications to the company via Amazon Simple Notification Service (Amazon SNS).

Explanation

Option A is optimal because Systems Manager Automation provides built-in error handling and integration with EventBridge for failure detection, eliminating custom error-checking logic. State Manager reliably schedules the Automation document daily. Run Command executes the script on target EC2 instances. EventBridge rules can natively trigger on Automation execution failures and forward notifications via SNS—requiring minimal development effort. Options B, C, and D introduce unnecessary complexity: B requires manual error-checking logic in Automation; C and D rely on Lambda, which lacks native OS-level script execution context and requires additional IAM and network configuration for EC2 interaction, increasing implementation overhead.