4 of the 7 questions we have for this objective, shown with the answer and the reasoning.
Design infrastructure as code
Vellacourt Insurance uses AWS Organizations with 140 member accounts in an organizational unit (OU) named Workloads. The platform team must deploy a standard set of IAM roles and an Amazon EventBridge rule to every account in Workloads and to every account added to that OU in the future, in two AWS Regions. A faulty template must not be rolled out to the whole organization at once: the deployment must stop after failures in more than two accounts.
Which two actions should the solutions architect take? Each correct answer presents part of the solution.
- ASet the StackSet operation preferences to a failure tolerance of 2 and a maximum concurrent account count that deploys to a small batch of accounts at a time.Failure tolerance stops the operation in a Region once more than the specified number of accounts fail, and limiting concurrency ensures only a small batch is affected before the operation halts.
- BAttach a service control policy to the Workloads OU that denies cloudformation:CreateStack if the stack fails.SCPs filter permissions based on request context; they cannot react to stack failures and would not limit the blast radius of a rollout.
- CUse an AWS CodePipeline pipeline with one CloudFormation deploy action per account and add a manual approval after each action.A pipeline with 280 account-and-Region actions is unmanageable, does not pick up new accounts automatically, and manual approvals add delay without enforcing a failure threshold.
- DCreate an AWS CloudFormation StackSet with service-managed permissions targeting the Workloads OU, and enable automatic deployment.Service-managed permissions use trusted access with Organizations, so no per-account administration roles are needed, and automatic deployment creates stack instances in accounts that join the target OU later.
- ECreate an AWS CloudFormation StackSet with self-managed permissions and add each new account ID to the StackSet when it is created.Self-managed permissions require creating execution roles in every target account and do not support automatic deployment to new OU members, so each new account becomes a manual step.
Why: CloudFormation StackSets is the native way to deploy one template across many accounts and Regions in an organization. With service-managed permissions it can target an OU and automatically deploy to accounts that join it, which removes the per-account onboarding step. Operation preferences control the blast radius: maximum concurrent accounts sets the batch size, and failure tolerance stops the rollout when failures exceed the threshold. The distractors either reintroduce manual per-account work or try to use a permissions guardrail as a deployment control.
Design infrastructure as code
Thornbury Media manages its production networking and database tier with an AWS CloudFormation stack named core-data. An engineer has edited the template to change the DBInstanceIdentifier of an Amazon RDS instance and the CIDR block of a subnet. The change advisory board requires that before any update is applied, reviewers see exactly which resources will be modified and whether any will be replaced.
What should the solutions architect do?
- ARun drift detection on core-data and share the drift results with the reviewers.Drift detection compares the live resources with the current stack template. It does not preview the effect of a proposed new template.
- BApply a stack policy that denies Update:Replace on all resources and run the update to see which resources fail.A stack policy can protect resources, but using failed updates as a preview is disruptive and gives reviewers no organized summary. It is a protection control, not a review mechanism.
- CEnable termination protection on core-data and apply the update directly with a CloudWatch alarm rollback trigger, relying on automatic rollback if a resource fails.Termination protection only prevents stack deletion, and rollback triggers act after the update starts. A successful replacement of the database would still occur without any prior review.
- DCreate a change set for core-data with the updated template and have reviewers check each resource change's Replacement field before executing it.A change set previews the proposed changes, including for each resource whether the update will modify it in place or replace it. Nothing changes until someone executes the change set.
Why: CloudFormation change sets are the review step for stack updates: they show every resource that will be added, modified or removed and whether a modification requires replacement. Changing properties such as a DB instance identifier or a subnet CIDR block forces replacement, which reviewers must see before approving. Drift detection and termination protection answer different questions, and a stack policy is a guardrail that complements, not replaces, a change set review.
Design infrastructure as code
Dalby Energy governs 60 accounts with AWS Control Tower. Application teams deploy infrastructure only through AWS CloudFormation. The cloud center of excellence wants to stop any CloudFormation stack from creating an S3 bucket without versioning or an RDS instance without storage encryption, and wants the check to happen before the resource is provisioned so that no noncompliant resource ever exists. It wants a managed control rather than custom code.
Which type of Control Tower control should the solutions architect enable on the workload OUs?
- ADetective controls, which use AWS Config rules to flag noncompliant buckets and DB instances.Detective controls report resources after they are created, so noncompliant resources would exist until someone fixes them.
- BPreventive controls implemented as service control policies that deny s3:CreateBucket and rds:CreateDBInstance.SCPs evaluate API actions and condition keys, and they cannot inspect the full CloudFormation resource configuration such as bucket versioning. Denying the create actions outright would block all buckets and databases.
- CProactive controls, which use CloudFormation hooks to evaluate resource configuration in a stack before provisioning.Proactive controls are implemented as CloudFormation hooks that check resource properties during stack operations and fail the operation if the resource would be noncompliant.
- DAn AWS Config conformance pack with automatic remediation through AWS Systems Manager Automation.Remediation runs after the resource exists, and it requires building and maintaining remediation documents rather than using a managed control.
Why: AWS Control Tower offers three behaviors for controls. Preventive controls use SCPs or RCPs to block actions, detective controls use AWS Config rules to find noncompliance after the fact, and proactive controls use CloudFormation hooks to check resources before they are provisioned through CloudFormation. When deployment is standardized on CloudFormation and the requirement is that noncompliant resources never exist, proactive controls are the fit. Mature governance models combine all three types.
Design infrastructure as code
Glenmore Analytics maintains 60 near-identical AWS CloudFormation YAML templates, one per customer environment, that differ only in a few parameters and loops of resources. Changes are copied by hand between templates and often drift. The developers work in TypeScript and want reusable components, loops and unit tests, but the operations team wants deployments to keep CloudFormation's change sets, rollback and drift detection.
Which approach should the solutions architect recommend?
- AWrite TypeScript scripts with the AWS SDK that create and update each resource directly.Imperative SDK scripts lose CloudFormation's state tracking, rollback and drift detection, which the operations team needs.
- BMerge all 60 templates into one CloudFormation template that uses Conditions, Mappings and the Fn::ForEach intrinsic function from the AWS::LanguageExtensions transform.Fn::ForEach adds loops, but one huge conditional template is harder to read, hits template limits, and offers no reusable TypeScript components or unit tests.
- CStore the 60 templates in AWS CodeCommit and require two reviewers for every change.Reviews catch some errors but do not remove the duplication that causes drift between templates.
- DDefine the infrastructure with the AWS CDK in TypeScript, package shared pieces as constructs, and deploy the synthesized stacks.CDK lets developers use a programming language with loops, classes and tests, and it synthesizes CloudFormation templates, so deployments keep change sets, rollback and drift detection.
Why: Infrastructure as code can be declarative, as in CloudFormation templates, or written in a general-purpose language. The AWS CDK combines both: you write imperative code with loops, abstractions and tests, and it synthesizes declarative CloudFormation, which then deploys with change sets, automatic rollback and drift detection. Direct SDK calls give up those safety features, which is the trade-off this question tests.