DOP-C02 Exam QuestionsBrowse all questions from this exam

DOP-C02 Exam - Question 70


A company has an application that runs on a fleet of Amazon EC2 instances. The application requires frequent restarts. The application logs contain error messages when a restart is required. The application logs are published to a log group in Amazon CloudWatch Logs.

An Amazon CloudWatch alarm notifies an application engineer through an Amazon Simple Notification Service (Amazon SNS) topic when the logs contain a large number of restart-related error messages. The application engineer manually restarts the application on the instances after the application engineer receives a notification from the SNS topic.

A DevOps engineer needs to implement a solution to automate the application restart on the instances without restarting the instances.

Which solution will meet these requirements in the MOST operationally efficient manner?

Show Answer
Correct Answer: D

The best solution involves configuring an AWS Systems Manager Automation runbook that runs a script to restart the application on the instances. Then, configure an Amazon EventBridge rule that reacts when the CloudWatch alarm enters the ALARM state and specify the runbook as a target of the rule. This approach is operationally efficient as it reduces the components involved: CloudWatch -> EventBridge -> SSM Automation runbook. This minimizes maintenance and avoids the need for custom Lambda functions.

Discussion

17 comments
Sign in to comment
daburahjailOption: D
Sep 18, 2023

It is debatable, as both C and D are correct and simple in their own ways, however, take a look at the number of components in each approach: C: CW -> SNS -> LAMBDA -> SSM (4) D: CW -> EVENTBRIDGE -> SSM (3) There is an extra component (SNS) to maintain on C, also, there is some coding involved on this option, which also needs to be maintained. Even if we already have the SNS created on option C, we still have to go there to remove the notification and configure the lambda invocation. Option D has fewer components, and require less customization.

ParagSanyashivOption: C
May 9, 2023

C makes more sense here

Chetantest07Option: B
Aug 6, 2023

The target of SNS can be a lamda function. The question is asking for most efficient and lease overhead. Why go extra effort of creating additional stuff when already the SNS is being sent to the engineer. Just add extra subscription to that SNS topic to a lamda function. in the lamda function. The target of SNS can be a lamda function: https://docs.aws.amazon.com/sns/latest/dg/sns-event-destinations.html

csG13Option: D
Dec 17, 2023

It’s D. Here is a reference: https://aws.amazon.com/blogs/mt/use-amazon-eventbridge-rules-to-run-aws-systems-manager-automation-in-response-to-cloudwatch-alarms/

AWSdeveloper08Option: D
Sep 29, 2023

Ill go with D too, less components, less configurations

HugoFMOption: D
Nov 28, 2023

D It's the most simples approach. But C its also a solution, but why build and mantain a lambda?

Diego1414Option: D
Feb 18, 2024

Both C and D are valid answers. However, D is less complicated.

beanxyz
Aug 22, 2023

I think both C and D will work, but the question is to chose the most efficient way, so I pickup D.

beanxyzOption: D
Sep 7, 2023

B is wrong because SSM document is used to run on managed instances so definitely more efficient than lambda. C is wrong because although this solution should work, we need to write a lambda script to invoke the runbook, while in D we don't need to do it

nlwOption: B
Nov 7, 2023

B seems like the shortest number of steps given that SNS already exists

zolthar_zOption: B
Nov 23, 2023

I think is B, you only need to create the lambda and update the SNS to the lambda,

z_inderjotOption: D
Dec 24, 2023

For me D is the answer , because we use lamba for the custom operations , if we already have SSM automation to perform that same action then why writing our custom logic in lambda ?

jojom19980Option: D
Feb 18, 2024

C is correct , But D is more easy to implement , cost saving, managed services by AWS ^_^

thanhnv142
Feb 1, 2024

B is correct: <implement a solution to automate the application restart on the instances> means we need to automate the restart step. We can use lambda, AWS system manager. <CloudWatch alarm notifies an application engineer through an Amazon Simple Notification Service> means we already have the alarm. We just need to simply trigger the restart process with lambda A, C and D are all too complicated compared to B. They ask for "the MOST operationally efficient manner", not the most complicated one

vn_thanhtung
May 13, 2024

Option B not correct. https://docs.aws.amazon.com/systems-manager/latest/userguide/running-automations-event-bridge.html

thanhnv142
Feb 1, 2024

B is correct: <implement a solution to automate the application restart on the instances> means we need to automate the restart step. We can use lambda, AWS system manager. <CloudWatch alarm notifies an application engineer through an Amazon Simple Notification Service> means we already have the alarm. We just need to simply trigger the restart process with lambda A, C and D are all too complicated compared to A. They ask for "the MOST operationally efficient manner", not the most complicated one

zijo
Mar 25, 2024

A is not possible - AWS Systems Manager (SSM) Run Command or Automation runbooks cannot be directly triggered by an Amazon SNS topic. Then C and D are the next best options. C is flexible but D is the most simple solution

xdkonorek2Option: D
Jun 30, 2024

D) B is wrong since it's way easier to use SSM automation runbook to execute logic inside instance using "run command" action within automation runbook than doing this with lambda