Schedule a State Manager association running an Automation document with EventBridge SNS failure notifications

Answer Correct answer: A — schedule a State Manager Automation document for the ordered deletions and use EventBridge with SNS for failure emails.

A company has a file-reading application that saves files to a database that runs on Amazon EC2 instances. Regulations require the company to delete files from EC2 instances every day at a specific time. The company must delete database records that are older than 60 days. The database record deletion must occur after the file deletions. The company has created scripts to delete files and database records. The company needs to receive an email notification for any failure of the deletion scripts. Which solution will meet these requirements with the LEAST development effort?

  1. Use AWS Systems Manager State Manager to automatically invoke a Systems Manager Automation document at the specified time each day. Configure the Automation document to use a run command to run the deletion scripts in sequential order. Create an Amazon EventBridge rule to use Amazon Simple Notification Service (Amazon SNS) to send failure notifications to the company. Correct Answer
  2. Use AWS Systems Manager State Manager to automatically invoke a Systems Manager Automation document at the specified time each day. Configure the Automation document to use a run command to run the deletion scripts in sequential order. Create a conditional statement inside the Automation document as the last step to check for errors. Use Amazon Simple Email Service (Amazon SES) to send failure notifications as email messages to the company.
  3. Create an Amazon EventBridge rule that invokes an AWS Lambda function at the specified time. Add the necessary permissions for the invocation to the Lambda function's resource-based policy. Configure the Lambda function to run the deletion scripts in sequential order. Configure the Lambda function to use Amazon Simple Notification Service (Amazon SNS) to send failure notifications to the company.
  4. Create an Amazon EventBridge rule that invokes an AWS Lambda function at the specified time. Add the necessary permissions for the invocation to the Lambda function's resource-based policy. Configure the Lambda function to run the deletion scripts in sequential order. Configure the Lambda function to use Amazon Simple Email Service (Amazon SES) to send failure notifications as email messages to the company.

Community Votes

A
78%
B
22%

78% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The requirement is the least development effort, and the deletion scripts already exist, so the solution should orchestrate them rather than reimplement their logic (A). State Manager supplies the daily schedule for managed instances without cron configuration, and the Automation document supplies the sequential execution that guarantees files are deleted before database records (A). EventBridge with SNS supplies failure notification as a managed service, so no error-handling code has to be written (A). Options B and D introduce Amazon SES, which would require the team to send email through a separate service, and options C and D replace the Systems Manager orchestration with a Lambda function that has to be written, configured, and permissioned.

Two deletions must run in order every day at a specific time and an email must be sent on failure. A Systems Manager State Manager association schedules the Automation document for that time, and the document runs the two existing deletion scripts in sequential order so file deletion precedes database record deletion, which satisfies the ordering requirement without rewriting the scripts. Amazon EventBridge then routes failures to Amazon SNS, and the SNS topic is subscribed with an email endpoint so the company receives the failure notification, giving the whole orchestration without writing application code.

Using a conditional statement inside the Automation document as the final step to check for errors and sending the notification with Amazon SES (B) — tinyshare observed that A and B are broadly similar, but B introduces Amazon SES for the email, which is an additional service to configure and manage; the requirement asks for the least development effort, and the SNS path in A is the conventional managed notification mechanism. Creating an EventBridge rule invoking a Lambda function and adding permissions to the function's resource-based policy (C and D) — this requires developing and deploying a function and granting it cross-service invocation permission, whereas A reuses the existing scripts through Systems Manager with no new code. Using Amazon SES for the failure email (C and D) — SES is a separate email service requiring its own configuration and, for automated sends, dedicated credentials, adding effort compared with an SNS topic subscription.

Community Discussion (3 comments)

uncledana 👍 6 Selected: A
Option A provides the most efficient solution with the least development effort. It uses AWS Systems Manager Automation for orchestrating the execution of deletion scripts and uses Amazon SNS to handle failure notifications, which is simpler and more streamlined than using SES.
Srikantha 👍 1 Selected: A
Systems Manager State Manager: Can schedule tasks like running scripts on EC2 without having to manage cron jobs or Lambda triggers. Automation Document with Run Command: Easily runs existing scripts on EC2 instances in sequence, fulfilling the requirement to delete files before database records. Amazon SNS + EventBridge: Out-of-the-box integration to notify on Automation execution failures — no need to build error-handling logic yourself.
tinyshare 👍 2 Selected: B
A and B are about the same, but B has specifics to check errors by using the return values.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The requirement is to run two existing deletion scripts in a specific order at a specific time each day and to be emailed on failure, with the least development effort. Because the scripts already exist, the solution should orchestrate them rather than rewrite their logic. A Systems Manager State Manager association invokes an Automation document at the specified time each day, which supplies the schedule for the managed instances without any cron configuration (A). The Automation document runs the deletion scripts in sequential order, so file deletion completes before database record deletion, which satisfies the explicit ordering requirement using the scripts as they are (A). An Amazon EventBridge rule is then used with Amazon SNS to send failure notifications to the company, and the SNS topic carries an email subscription so the message reaches the team (A). Every component is a managed service performing orchestration, scheduling, ordering, and notification, so no application code has to be written. uncledana characterized option A as providing the most efficient solution with the least development effort because it uses Systems Manager Automation for orchestration and SNS for notification, and Srikantha noted that State Manager can schedule such tasks without managing cron jobs or Lambda triggers. A is the correct answer.

Why the Other Options Are Wrong

B uses State Manager to schedule an Automation document that runs the deletion scripts in sequential order, adds a conditional statement as the document's final step to check for errors, and uses Amazon Simple Email Service to send the failure emails. tinyshare correctly observed that A and B are broadly similar and that B adds specifics for checking errors, which is a reasonable point; the deciding factor is the notification mechanism, because Amazon SES is a separate email service that must be configured and, for automated sending, requires dedicated SES credentials, whereas an SNS topic with an email subscription is the standard managed path and requires no additional credential setup. That makes B the higher-effort option, which the requirement rules out. C creates an EventBridge rule that invokes a Lambda function at the specified time, adds permissions for the invocation to the function's resource-based policy, has the function run the deletion scripts in order, and uses SNS for failure notifications. This replaces the Systems Manager orchestration with a function that must be written, deployed, maintained, and explicitly permitted to be invoked, which is more development effort than scheduling an Automation document that runs the existing scripts. D has the same Lambda-based design and additionally uses Amazon SES for the failure email, compounding the two sources of extra effort. A is correct.

Community Comment Notes

Community voted A (78), with B a minority (22). uncledana gave the highest-rated comment, explaining that option A provides the most efficient solution with the least development effort because it uses Systems Manager Automation for orchestration and SNS for notification. Srikantha noted that State Manager can schedule tasks such as running scripts on EC2 without managing cron jobs or Lambda triggers, and that an Automation document with Run Command easily runs existing scripts, which is why the Lambda-based options add unnecessary work. tinyshare was the sole dissenter, favoring B because it adds a conditional statement that checks errors using return values; that is a legitimate difference but it does not offset the additional Amazon SES configuration B requires. No alternative received majority support.

Official Reference

Related Analysis

Practice All DOP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full DOP-C02 Practice Test →

← Back to DOP-C02 Study Guide