AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 168

A company manages AWS accounts for application teams in AWS Control Tower. Individual application teams are responsible for securing their respective AWS accounts.

A DevOps engineer needs to enable Amazon GuardDuty for all AWS accounts in which the application teams have not already enabled GuardDuty. The DevOps engineer is using AWS CloudFormation StackSets from the AWS Control Tower management account.

How should the DevOps engineer configure the CloudFormation template to prevent failure during the StackSets deployment?

Answer options

Correct answer: A

Explanation

Option A is correct because it uses a CloudFormation custom resource with a Lambda function to conditionally enable GuardDuty, thus preventing deployment failures. The other options do not provide a reliable way to handle accounts that may already have GuardDuty enabled, potentially leading to errors during the deployment process.