DOP-C02 sample questions with answers and explanations
10 real questions from the CertifyDeck DOP-C02 bank, spread across the domains of the official AWS Certified DevOps Engineer - Professional skills outline, with the correct answer and a full explanation of why the other options are wrong. They are original questions written from the public syllabus, not exam dumps, and they are the same style you will find in the practice tests and mock exams.
Question 1Domain: Monitoring and LoggingMedium
A company ingests large volumes of verbose debug logs from a batch platform into a CloudWatch Logs log group in the Standard log class. The logs are used only for occasional after-the-fact investigations with CloudWatch Logs Insights, and no metric filters, subscription filters or Live Tail sessions use them. The DevOps team wants to lower the ingestion cost of these logs while keeping the ability to query them with Logs Insights. What should the DevOps team do?
A.Create a new log group in the Essentials log class, point the batch platform's log configuration to it, and keep the old log group until its retention expires.
B.Set the retention of the existing log group to one day so that CloudWatch Logs charges less for every gigabyte of debug logs that the batch platform ingests.
C.Create a new log group in the Delivery log class so that the debug logs are kept at a lower price and can still be queried with CloudWatch Logs Insights when needed.
D.Change the log class of the existing log group to Essentials with the CloudWatch Logs API, and keep the batch platform writing to the same log group as before.
Show answer and explanation
Correct answer: A. Create a new log group in the Essentials log class, point the batch platform's log configuration to it, and keep the old log group until its retention expires.
Explanation
The Essentials log class (formerly Infrequent Access) has a lower ingestion price and supports CloudWatch Logs Insights queries, and it lacks only features such as metric filters, subscription filters and Live Tail that these logs do not use; because a log group's class cannot be changed after creation, the logs must go to a new log group. Retention affects storage, not ingestion. The Delivery class is only for delivering Lambda logs to Amazon S3 or Firehose and does not support Logs Insights queries.
A SaaS company uses a CodePipeline deployment role to create CloudWatch Logs log groups with the --kms-key-id parameter. The role has IAM permissions for logs:CreateLogGroup and logs:AssociateKmsKey, and the key policy already grants the CloudWatch Logs service principal the required encryption actions. The CreateLogGroup calls now fail with an AccessDeniedException. The DevOps engineer must fix the issue while following the principle of least privilege. What should the DevOps engineer do?
A.Allow the deployment role kms:DescribeKey on the key, with a kms:ViaService condition that limits the permission to calls made through logs.region.amazonaws.com.
B.Allow the deployment role kms:CreateGrant on the key so that the role can delegate use of the key to CloudWatch Logs when it creates each log group.
C.Add the deployment role to the key policy with only kms:Decrypt, so that the role can read the encrypted log data after it creates the log group.
D.Add a statement to the role policy that allows kms:* on all resources, so that the role can use any KMS key that a log group might be associated with in the future.
Show answer and explanation
Question 3Domain: Configuration Management and IaCMedium
A company has a network stack that exports the IDs of its private subnets, and twelve application stacks in the same account and Region import them with Fn::ImportValue. A DevOps engineer changes the network template so that one export keeps its name but returns the ID of a new subnet, and the stack update fails. The network stack has termination protection turned on and has no stack policy. What is the MOST likely cause of this issue?
A.The export is imported by other stacks, and an exported output value cannot be modified until every import of it has been removed.
B.The new subnet ID is returned with Ref, and the Value of an exported output cannot use Ref or Fn::GetAtt functions that depend on a resource.
C.Export names must be unique in the Region, and the update fails because an export with the same name already exists in the account.
D.Termination protection on the network stack blocks any stack update that would change one of the values in its Outputs section.
Show answer and explanation
Correct answer: A. The export is imported by other stacks, and an exported output value cannot be modified until every import of it has been removed.
Question 4Domain: Configuration Management and IaCEasy
A financial services company manages 250 Windows Server instances with AWS Systems Manager. The platform team has written PowerShell Desired State Configuration (DSC) configurations and compiled them into MOF files stored in an Amazon S3 bucket. During the first month, the team must only find out which servers drift from the configuration, without changing any server, and must keep the results in S3 for auditors. Which solution will meet these requirements with the LEAST operational overhead?
A.Deploy the AWS Config managed rule ec2-managedinstance-applications-blacklisted with the list of applications that the DSC configurations forbid, and store the evaluations in S3.
B.Create a State Manager association that uses the AWS-ApplyDSCMofs document with the MOF operation mode set to Apply and a report bucket name, scheduled to run once every day on all the Windows servers.
C.Run the AWS-ApplyDSCMofs document once with Run Command on the Windows servers and send the command output to the S3 bucket for the auditors.
D.Create a State Manager association that uses the AWS-ApplyDSCMofs document with the MOF operation mode set to ReportOnly and a report bucket name, scheduled to run daily on the Windows servers.
Show answer and explanation
Question 5Domain: Incident and Event ResponseMedium
A company wants one place where operators see operational issues, such as EC2 instances that fail status checks, together with related CloudWatch metrics and alarms, CloudTrail logs and AWS Config details, and where they can run a remediation runbook against the affected resource from the same view. The issues must be created automatically from the events, and the company does not want to build a custom portal. Which solution will meet these requirements?
A.Build a CloudWatch dashboard with alarm widgets for each instance and attach Lambda functions to the alarm actions that restart instances and log the result.
B.Create an AWS Config aggregator that shows the noncompliant resources of all accounts and have operators start remediation runbooks from the aggregator view.
C.Send the events to an SNS topic that emails the operators, who then open the EC2 console and restart each affected instance by hand when they receive a message.
D.Have EventBridge rules create OpsItems in Systems Manager OpsCenter, and let operators run associated runbooks such as AWS-RestartEC2Instance from each OpsItem.
Show answer and explanation
Question 6Domain: Security and ComplianceEasy
A financial services company has enabled automated sensitive data discovery in Amazon Macie in a standalone account. A DevOps engineer notices that Macie reports only metadata for the objects in one Amazon S3 bucket and never analyzes their content. That bucket uses default encryption with SSE-KMS and a customer managed key whose key policy allows only the application's IAM role to use the key. Objects in other buckets that use SSE-S3 are analyzed normally. What should the DevOps engineer do to resolve this issue?
A.Change the default encryption of the bucket to server-side encryption with customer-provided keys (SSE-C) and re-upload the objects so that Macie no longer needs AWS KMS permissions to read them.
B.Attach an inline IAM policy that allows kms:Decrypt on the key to the Macie service-linked role, and leave the key policy unchanged so that it continues to list only the application role.
C.Add a statement to the key policy of the customer managed key that allows the Macie service-linked role of the account, AWSServiceRoleForAmazonMacie, to perform kms:Decrypt with the key.
D.Create a Macie allow list that contains the name of the bucket and the key ARN, and add the list to the automated sensitive data discovery settings of the account.
Show answer and explanation
Question 7Domain: Resilient Cloud SolutionsMedium
A financial services company runs a trading dashboard on an EC2 Auto Scaling group behind an Application Load Balancer. Load rises sharply every weekday when markets open and falls in the evening and at weekends, and the opening time shifts with daylight saving changes in several countries. With target tracking alone, users see slow responses for the first minutes of each day. The team does not want to keep updating schedules by hand or keep peak capacity all night. Which solution will meet these requirements?
A.Create recurring scheduled actions that raise the desired capacity 15 minutes before each market opening and lower it in the evening, and update them when the clocks change.
B.Add a predictive scaling policy that forecasts capacity from the daily and weekly load history and launches instances ahead of the forecast increase.
C.Set the minimum capacity of the group to the number of instances needed at market opening so that the capacity is always available.
D.Replace target tracking with a step scaling policy that adds a large number of instances when CPU utilization goes above 60% for one minute.
Show answer and explanation
Question 8Domain: Resilient Cloud SolutionsMedium
A company runs a Java web application on Amazon EC2 instances in an Auto Scaling group behind an Application Load Balancer. The group has Elastic Load Balancing health checks turned on so that instances that fail the target group health check are replaced. After a larger application build was released, new instances need about four minutes to start the application, and the Auto Scaling activity history shows new instances being terminated as unhealthy shortly after launch, in a loop. The group was created with the AWS CLI without any other health settings. What is the MOST likely cause of this issue?
A.The deregistration delay of the target group is too short, so in-flight requests to the new instances are dropped and the load balancer reports those instances as unhealthy.
B.Cross-zone load balancing is turned off for the target group, so new instances in one Availability Zone fail health checks until the other zone has been drained.
C.The health check grace period is 0, so Amazon EC2 Auto Scaling acts on failed load balancer health checks while the application on new instances is still starting.
D.The Auto Scaling group still evaluates only EC2 status checks, so instances that are still booting the operating system are reported as impaired and replaced.
Show answer and explanation
Question 9Domain: SDLC AutomationEasy
A DevOps engineer creates a new AWS CodeDeploy deployment group for EC2 instances in the eu-west-1 Region. The application revision is stored in an S3 bucket that the company created in us-east-1, and the instance profile allows s3:Get* and s3:List* on that bucket. Every deployment fails at the DownloadBundle lifecycle event with UnknownError: not opened for reading. Deployment groups in us-east-1 that use the same bucket succeed. What is the MOST likely cause of this issue?
A.The CodeDeploy service role is missing the AWSCodeDeployRole managed policy for the deployment group in eu-west-1.
B.The revision bucket is in a different AWS Region from the instances, so the revision must be stored in an S3 bucket in eu-west-1.
C.The clocks of the new instances are not synchronized, so the agent's requests to Amazon S3 are rejected with an expired signature.
D.The bucket policy denies requests that do not use TLS, and the CodeDeploy agent downloads revisions from Amazon S3 over plain HTTP.
Show answer and explanation
Correct answer: B. The revision bucket is in a different AWS Region from the instances, so the revision must be stored in an S3 bucket in eu-west-1.
Question 10Domain: SDLC AutomationEasy
A company builds container images in AWS CodeBuild and pushes them to Amazon ECR as part of an AWS CodePipeline pipeline. A new security requirement states that the pipeline must stop before deployment if an image has any critical vulnerabilities, and that the highest severity found must be available to later actions. The DevOps engineer must meet this requirement with the LEAST operational overhead. Which solution will meet these requirements?
A.Add a Commands action that installs an open source image scanner, scans the pushed image, and exits with a non-zero code when it finds critical vulnerabilities.
B.Turn on basic scanning on push for the repository and add a scheduled Lambda function that reads the findings and disables the stage transition when critical findings exist.
C.Add an Amazon Inspector InspectorScan action with InspectorRunMode set to ECRImageScan, the repository name and image tag, and CriticalThreshold set to 0.
D.Associate the repository with Amazon CodeGuru Reviewer and add a manual approval action so that a reviewer checks its recommendations before deployment.
Show answer and explanation
How to use these DOP-C02 sample questions
Answer each question before opening the explanation, and write down why you discarded the other options. On DOP-C02, most mistakes come from choosing an option that is technically possible but does not meet every requirement in the scenario.
These 10 questions are a taste of the format, not a diagnostic. To know which domains you fail, practice by domain for free and take a timed mock exam that mirrors the official weights and duration.
Practice DOP-C02 with hundreds more questions
Start for free, no sign-up or card. Every question includes an explanation like the ones above, and the mock exam reproduces the official DOP-C02 format.
Correct answer: A. Allow the deployment role kms:DescribeKey on the key, with a kms:ViaService condition that limits the permission to calls made through logs.region.amazonaws.com.
Explanation
The principal that calls CreateLogGroup with a kmsKeyId, or AssociateKmsKey, must have kms:DescribeKey on the key, and the documentation scopes it with a kms:ViaService condition for the CloudWatch Logs endpoint; without it the call fails with AccessDeniedException. Allowing kms:* on all resources fixes the error but grants far more access than needed. kms:CreateGrant and kms:Decrypt are not the permission that the association call checks, so the call would keep failing.
After another stack imports an exported output, CloudFormation does not allow the exporting stack to modify that output value or to be deleted until all imports are removed, so the importing stacks must stop using the export first. Termination protection applies only to stack deletion, and the export already belongs to this stack, so its name is not a conflict. The restriction on Ref and Fn::GetAtt applies to the Name of an export, not to its Value, which commonly uses Ref.
Correct answer: D. Create a State Manager association that uses the AWS-ApplyDSCMofs document with the MOF operation mode set to ReportOnly and a report bucket name, scheduled to run daily on the Windows servers.
Explanation
AWS-ApplyDSCMofs has a ReportOnly mode that logs compliance data and reports noncompliant nodes without correcting them, and it can write compliance reports in JSON to an S3 report bucket on every association run. Apply mode corrects noncompliant configurations, which changes servers during the audit-only month. A single Run Command execution does not keep detecting drift over the month, and the AWS Config rule only checks installed applications from Inventory, not the settings defined in the DSC configurations.
Correct answer: D. Have EventBridge rules create OpsItems in Systems Manager OpsCenter, and let operators run associated runbooks such as AWS-RestartEC2Instance from each OpsItem.
Explanation
EventBridge rules can target OpsCenter to create OpsItems automatically, each OpsItem's related resource page shows CloudWatch metrics and alarms, CloudTrail logs and AWS Config details, and operators can run Automation runbooks against the related resource from the OpsItem. Email notifications leave the investigation and fix in separate consoles. An aggregator is a view of configuration and compliance data, and the dashboard with Lambda alarm actions is a custom build.
Correct answer: C. Add a statement to the key policy of the customer managed key that allows the Macie service-linked role of the account, AWSServiceRoleForAmazonMacie, to perform kms:Decrypt with the key.
Explanation
Macie decrypts SSE-KMS objects only when it is allowed to use the customer managed key; when the key and bucket are in the same account, the key policy needs a statement that lets the Macie service-linked role call kms:Decrypt, otherwise Macie stores and reports only object metadata. An IAM policy alone does not help because the key policy must allow access before IAM policies can take effect. SSE-C objects cannot be decrypted by Macie at all, and allow lists only define text that Macie ignores.
Correct answer: B. Add a predictive scaling policy that forecasts capacity from the daily and weekly load history and launches instances ahead of the forecast increase.
Explanation
Predictive scaling analyzes historical load to detect daily or weekly patterns and launches capacity in advance of the forecasted load, so the team does not need to review load patterns and maintain schedules. Scheduled actions would work but need manual updates whenever the opening time shifts, which the team wants to avoid. Step scaling is still reactive and starts after users are already affected, and a higher minimum keeps peak capacity running all night.
Correct answer: C. The health check grace period is 0, so Amazon EC2 Auto Scaling acts on failed load balancer health checks while the application on new instances is still starting.
Explanation
The health check grace period keeps a new instance in service for a minimum time before Auto Scaling acts on a failed health check; it defaults to 0 (turned off) when the group is created with the AWS CLI or an SDK, so load balancer health check failures during application startup cause terminations. Setting a grace period that covers the startup time, or using a launch lifecycle hook, fixes it. The stem says ELB health checks are already on, and deregistration delay and cross-zone settings do not mark booting targets unhealthy.
The troubleshooting guide lists two causes for DownloadBundle failing with UnknownError: not opened for reading: an instance profile without access to the revision, or a revision bucket in a different Region from the instances, and the permissions here are already in place. An unsynchronized clock produces an InvalidSignatureException with a signature expired message, the agent communicates over HTTPS, and a missing service role policy would not depend on where the bucket is.
Correct answer: C. Add an Amazon Inspector InspectorScan action with InspectorRunMode set to ECRImageScan, the repository name and image tag, and CriticalThreshold set to 0.
Explanation
The InspectorScan action is a managed CodePipeline action that scans an ECR image (ECRImageScan), fails when the number of critical findings exceeds CriticalThreshold, and exposes HighestScannedSeverity as an output variable. A scheduled Lambda function is custom code that polls instead of gating the running execution, and a self-installed open source scanner adds a third-party tool the company would have to maintain. CodeGuru Reviewer cannot take new repository associations and reviews source code, not container images.