Courseiva
Monitoring and Logging →mediumMultiple Choice

CloudFormation Stack Failure Notification with SNS

A company is using AWS CloudFormation to deploy infrastructure. They want to receive notifications when a stack operation fails, including the specific resource that caused the failure. Which approach should they use?

Quick Answer

The correct approach is to configure an SNS topic as a notification option in the CloudFormation stack and subscribe to receive stack events. This works because CloudFormation natively publishes failure notifications to the specified SNS topic, and each event includes the logical resource ID and the status reason for the failure, giving you the exact resource details without needing to poll the API or set up additional monitoring. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this question tests your understanding of CloudFormation’s built-in notification mechanism versus workarounds like Lambda triggers or custom scripts—a common trap is assuming you need to parse CloudTrail logs or use EventBridge, but SNS is the simplest direct integration. For a quick memory tip, think “Stack fails, SNS mails the details”—the notification option is set at the stack level, not per resource, and it delivers the failing resource’s logical ID and reason in real time.

⚠ Common exam trap

Test-takers frequently confuse CloudWatch metrics or CloudTrail with CloudFormation's native notification capability, assuming that failure events are exposed as metrics or logs rather than through SNS topic subscriptions.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Configure an SNS topic as a notification option in the CloudFormation stack and subscribe to receive stack events.

CloudFormation allows you to specify an SNS topic ARN as a notification option when creating or updating a stack. When a stack operation fails, CloudFormation publishes a notification to that SNS topic, and the notification includes the logical resource ID and the status reason for the failure. This provides real-time, event-driven notifications without requiring polling or additional services.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Create a CloudWatch alarm on the 'StackFailure' metric.

    Why it's wrong here

    CloudFormation does not publish a 'StackFailure' metric to CloudWatch, so no alarm can target it. CloudWatch alarms suit metric-threshold monitoring; stack failure events with the failing resource are delivered through Amazon SNS topics configured on the stack's notification options.

  • ✓

    Configure an SNS topic as a notification option in the CloudFormation stack and subscribe to receive stack events.

    Why this is correct

    Configuring an SNS topic as a stack notification option delivers every CloudFormation stack event, including ResourceStatusReason for the specific resource that failed, satisfying the requirement to identify the failing resource. Subscribing an email or Lambda endpoint to that topic then surfaces the failure notification automatically.

  • ✗

    Create an AWS Lambda function that polls the CloudFormation DescribeStackEvents API every minute and sends an email on failure.

    Why it's wrong here

    Polling DescribeStackEvents introduces up to a minute of latency and misses the event-driven delivery CloudFormation already provides through EventBridge, so the failing resource arrives late or not at all. Lambda polling suits scheduled reconciliation tasks, not real-time stack failure alerting.

  • ✗

    Enable AWS CloudTrail to log CloudFormation API calls and configure an SNS notification on the trail.

    Why it's wrong here

    CloudTrail records the CloudFormation API call itself, not the individual resource failure detail, and SNS on a trail cannot filter to the specific resource that broke. CloudTrail suits auditing API activity across accounts, not per-resource stack event notification.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is using AWS CloudFormation to deploy infrastructure. The DevOps team wants to receive notifications when a stack creation fails. Which services can be used together to send an email notification on stack failure? (Choose TWO.)

easy
  • A.AWS Lambda
  • B.Amazon Simple Queue Service (SQS)
  • ✓ C.Amazon Simple Notification Service (SNS)
  • ✓ D.AWS CloudFormation
  • E.Amazon CloudWatch

Why C: Amazon SNS (Option C) is correct because it can send email notifications to subscribers when a CloudFormation stack creation fails. AWS CloudFormation (Option D) is correct because it can directly publish failure events to an SNS topic via the 'NotificationARNs' parameter in stack creation, enabling automated email alerts without additional services.

Variation 2. A company is using AWS CloudFormation to manage infrastructure. The DevOps team wants to receive notifications when CloudFormation stack creation fails. Which AWS service should be used to capture the stack failure event and send a notification?

easy
  • A.Amazon SQS
  • B.Amazon CloudWatch Logs
  • C.AWS CloudTrail
  • ✓ D.Amazon EventBridge

Why D: Amazon EventBridge can capture CloudFormation stack events (such as CREATE_FAILED) using event rules and route them to targets like Amazon SNS for notifications. Option A is wrong because Amazon SQS is a message queue service and does not directly send notifications; it requires a consumer. Option B is wrong because Amazon CloudWatch Logs stores log data but does not capture CloudFormation events or send notifications. Option C is wrong because AWS CloudTrail records API calls but is not designed for real-time event-driven notifications; it is better suited for auditing.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.