Home › Certifications › AWS Certified DevOps Engineer DOP-C02 › Configuration Management and Infrastructure as Code
26 multiple-choice questions and 21 flashcards on Configuration Management and Infrastructure as Code, about 17% of the AWS Certified DevOps Engineer DOP-C02 bank. Every one carries a written rationale.
Configuration Management and Infrastructure as Code is one of 6 chapters in CoStudy's AWS Certified DevOps Engineer — Professional (DOP-C02) bank, and it holds 26 of the bank's 150 multiple-choice questions — roughly 17% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.
Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.
10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.
A team uses CloudFormation drift detection on a critical network stack. They want any detected drift to automatically trigger a Slack notification AND open an Incident Manager incident. Which integration is BEST?
Answer: C — Schedule drift detection via EventBridge → an SSM Automation document that starts drift detection, then route results through AWS Chatbot to Slack and to Incident Manager
CFN drift isn't continuous — schedule it. SSM Automation can chain the multi-target response. Chatbot integrates with Slack. B is custom. C/D miss CFN-specific drift.
A Systems Manager State Manager association installs the CloudWatch agent on every EC2 instance. New instances launched from an ASG aren't getting the agent until 30 minutes later. Which change BEST reduces the delay?
Answer: A — Use an EC2 launch template UserData that runs the SSM Run Command
State Manager is scheduled remediation. For boot-time install, bake into AMI or run at UserData. A increases load without helping new instances faster. C/D are wrong.
A CDK app needs to generate an IAM policy whose actions depend on a config file processed at synth time. Which construct/pattern is MOST appropriate?
Answer: C — Read the config in TypeScript and pass values into PolicyStatement
CDK is code — synth-time config is just programmatic input. B is for cross-cutting concerns (e.g., tag enforcement). A introduces a macro for no reason. D runs at deploy, not synth.
A team's SAM template defines an API Gateway + Lambda. Local testing with 'sam local invoke' works, but deploy fails with 'Transform AWS::Serverless-2016-10-31 not supported'. What is the FIX?
Answer: A — Run 'sam build' then 'sam deploy --guided', which packages the template (resolving the Transform) before invoking CloudFormation
SAM templates require the Transform header; sam deploy handles it. Direct 'aws cloudformation deploy' on a SAM template without packaging will fail. B/C/D miss the point.
Which AWS service is BEST for ad-hoc infrastructure operations like patching, automation runbooks, and remote command execution?
Answer: B — AWS Systems Manager — Run Command for ad-hoc execution, Patch Manager for automated patching, and Automation for runbooks
Systems Manager: operations control plane. Run Command (ad-hoc), Patch Manager (auto-patching), State Manager (desired state), Automation (workflows), Session Manager (shell access), Parameter Store (config), Inventory. DOP staple.
CloudFormation Drift Detection:
Answer: D — Identifies when actual resource configurations have diverged from what the CloudFormation template defines
A) Drift detection reports differences; it doesn't auto-revert resources. B) CodePipeline doesn't natively gate on CloudFormation drift. C) CloudTrail logs who made a change, not whether it diverged from the template. D) Correct: Drift detection identifies when actual resource configuration has diverged from what the template defines.
A CloudFormation template references a SecureString parameter from SSM Parameter Store with dynamic reference {{resolve:ssm-secure:/db/pass}}. The deploy fails with a parser error. What is the MOST likely cause?
Answer: A — CloudFormation does not resolve ssm-secure for most resource
Dynamic ssm-secure references are restricted to a specific set of property types. C is wrong — it works on allowed properties. B/D are fabrications.
A CloudFormation stack deploys an Aurora cluster, an ElastiCache Redis cluster, and an ALB. During the deploy, the ALB's listener fails to create due to a missing target group. CloudFormation begins UPDATE_ROLLBACK. The team wants the rollback to also revert RDS schema migrations that ran in a custom resource. Which approach BEST achieves this?
Answer: A — Add an IsRollback parameter to the custom resource's Lambda
Custom resources receive Delete events on rollback when the resource was Created in the failed update. The handler can run reverse logic. B is for alarm-driven rollback, not migration reversal. C ignores the problem. D doesn't undo schema.
AWS SYSTEMS MANAGER PATCH MANAGER:
Answer: A — Automated OS PATCHING for EC2 + on-premises servers
Patch Manager: critical security. Baselines per OS. Approval rules (auto-approve security patches after N days). Compliance scans. Run via Maintenance Window or on-demand. Integrates with Inventory for tracking. Alternative: AWS Systems Manager Quick Setup for org-wide deployment. DOP security automation.
A team has a CloudFormation stack with 200+ resources. They want to break it into smaller stacks WITHOUT recreating any resources. Which is the CORRECT approach?
Answer: C — Use stack-import to move existing resources into new stacks
CloudFormation supports resource import — defining the resource in a new template and importing the existing physical resource. A causes outage. C/D don't move resources.
4 cards from the 21 in this chapter.
CloudFormation change sets?
Preview changes before applying. Rollback risk reduction.
CDK constructs levels?
L1 (CFN resources), L2 (curated APIs), L3 (patterns).
SSM Run Command vs State Manager?
Run Command: one-time. State Manager: maintain desired config.
OpsWorks?
Chef/Puppet managed service. Less common — Systems Manager preferred.
These are a sample. The full Configuration Management and Infrastructure as Code chapter runs 47 items with per-chapter progress tracking, on the web and in the iOS app.
Open AWS Certified DevOps Engineer DOP-C02 in CoStudy →
All AWS Certified DevOps Engineer DOP-C02 practice questions →