A company runs a file-reading application that stores files in a database on Amazon EC2 instances. Regulations require daily deletion of files from the EC2 instances at a specific time, and database records older than 60 days must be removed. Database deletions must occur after the file deletions. The company already has scripts for both deletion tasks and needs email alerts for any deletion-script failures. Which solution meets these requirements with the least development effort?
Choose an answer
Tap an option to check your answer.
Correct answer: Use AWS Systems Manager State Manager to schedule a Systems Manager Automation document at the required time each day. In the Automation document use Run Command to execute the deletion scripts sequentially. Create an Amazon EventBridge rule that publishes failure events to an Amazon SNS topic to send email notifications to the company..
Why this is the answer
The correct solution leverages AWS Systems Manager State Manager to schedule an Automation document daily. This document uses Run Command to execute the existing deletion scripts on the EC2 instances sequentially, ensuring file deletions precede database deletions. An Amazon EventBridge rule is then configured to monitor for AutomationExecutionFailed events from Systems Manager and publish these to an Amazon SNS topic, which sends email notifications for any script failures. This approach minimizes development effort by reusing existing scripts and using native AWS services for orchestration, scheduling, and notification. The incorrect options either introduce unnecessary complexity (e.g., conditional steps within Automation for email, or using SES directly within Automation, which is less integrated for failure notifications) or require more development effort (e.g., rewriting scripts to run within a Lambda function, which might exceed Lambda's execution limits or require significant refactoring for EC2 interaction).
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed