AWS SysOps Admin SOA-C02 · Deployment, Provisioning, and Automation · medium

A production VPC Security Group and an Amazon S3 bucket were originally provisioned by an AWS CloudFormation stack (Prod-Core-Stack). Two weeks later, an on-call engineer manually added an emergency inbound rule (TCP 8080 from 203.0.113.5/32) to the Security Group in the AWS Management Console. Before running the next stack update, how can the SysOps administrator identify all resources in Prod-Core-Stack whose live configuration diverges from the CloudFormation template?

Published · Last updated · checked before publication — how we verify questions

Options

  • ARun aws cloudformation validate-template against the local YAML file in Git
  • BEnable TerminationProtection on Prod-Core-Stack in the CloudFormation console
  • CAdd a DeletionPolicy: Retain attribute to the Security Group
  • DRun CloudFormation Drift Detection (DetectStackDrift) on Prod-Core-StackCorrect answer

Answer: D. Run CloudFormation Drift Detection (DetectStackDrift) on Prod-Core-Stack

AWS CloudFormation Drift Detection (DetectStackDrift / DetectStackResourceDrift) compares the current live state of stack resources against the expected property values defined in the stack's CloudFormation template and reports resources as MODIFIED (DRIFTED), DELETED, or IN_SYNC.

Why the other options are wrong

  • A. Run aws cloudformation validate-template against the local YAML file in Git — validate-template only checks YAML/JSON syntax locally; it never inspects live deployed AWS resources.
  • B. Enable TerminationProtection on Prod-Core-Stack in the CloudFormation console — Stack Termination Protection prevents accidental DeleteStack calls, not out-of-band console edits.
  • C. Add a DeletionPolicy: Retain attribute to the Security Group — DeletionPolicy: Retain controls behavior when a resource is deleted, not drift auditing.

All Deployment, Provisioning, and Automation questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.