AWS DOP-C02 Practice Exam

AWS Certified DevOps Engineer Professional DOP-C02

The AWS Certified DevOps Engineer - Professional certification validates the ability to automate the testing and deployment of AWS infrastructure and applications. The exam covers six domains: SDLC Automation, Configuration Management and Infrastructure as Code, Resilient Cloud Solutions, Monitoring and Logging, Incident and Event Response, and Security and Compliance. It draws on services such as CodePipeline, CodeBuild, CodeDeploy, CloudFormation, Systems Manager, CloudWatch, EventBridge, Auto Scaling, ECS, EKS, Lambda and AWS Organizations. Candidates are tested on designing and troubleshooting automated delivery pipelines and operational controls at scale. This certification suits DevOps engineers with two or more years of AWS experience.

843 questions in the bank

Question bank updated : questions, answers, explanations and chapters.

Certification Overview

  • Exam name: DOP-C02
  • Vendor: AWS
  • Exam code: DOP-C02
  • Duration: 180 minutes
  • Total questions: about 75
  • Official passing score: 750 on a scale of 100-1,000 (source)
  • Our practice exam pass mark: 75%

Who Should Take This Exam?

DevOps Engineer, Site Reliability Engineer, Platform Engineer, Cloud Engineer, Release Engineer, Infrastructure Automation Engineer, Systems Architect

Prerequisites

No prior certification is required. AWS recommends two or more years of experience provisioning, operating and managing AWS environments.

Topics Covered

  • SDLC Automation
  • Configuration Management and IaC
  • Resilient Cloud Solutions
  • Monitoring and Logging
  • Incident and Event Response
  • Security and Compliance

Question Types

  • Multiple Choice (Single Answer)
  • Multiple Choice (Multiple Answers)

DOP-C02 Practice Questions

Our question bank contains 843+ practice questions for this certification. Sample questions from each exam chapter. Expand a question to see the answer choices. With full access, you get unlimited practice exams with randomized questions from our full question bank.

SDLC Automation

An application team wants a failed AWS CodeDeploy deployment to roll back automatically to the last known good revision. Which setting should the team enable?
  • A. Minimum healthy hosts of zero percent
  • B. Automatic rollback on deployment failure Correct answer
  • C. A CodeDeploy AppSpec validate hook
  • D. Blue/green traffic shifting with CodeDeploy

Option B is correct because enabling automatic rollback on deployment failure is the CodeDeploy setting that reverts to the last known good revision when a deployment fails. A minimum healthy hosts of zero percent (A) allows all hosts to be replaced at once but doesn't trigger a rollback, an AppSpec validate hook (C) isn't a real rollback mechanism, and blue/green traffic shifting (D) controls how traffic moves rather than whether a failed deployment rolls back.

Which TWO practices reduce the risk that a shared CodeBuild cache degrades build reliability across multiple concurrently running branches?
  • A. Include the branch or commit identifier in the S3 cache path Correct answer
  • B. Scope the cache to specific dependency directories rather than the whole workspace Correct answer
  • C. Disable VPC connectivity for the build environment
  • D. Grant the CodeBuild service role administrator access to the artifact bucket
  • E. Increase the number of retries on the source stage

Options A and B are correct because including a branch or commit identifier in the S3 cache path prevents concurrent branches from clobbering each other's cached artifacts, and scoping the cache to specific dependency directories avoids stale or unrelated files polluting the build. Option C (disabling VPC connectivity) has nothing to do with cache isolation, Option D (granting admin access) is a security anti-pattern unrelated to reliability, and Option E (more source-stage retries) doesn't address cache contention at all.

A DevOps engineer configures an AWS CodeBuild project to decrypt build artifacts that were encrypted with a customer managed AWS KMS key in a different AWS account. The engineer needs a mechanism that grants the CodeBuild service role decrypt access without modifying the key policy each time a new pipeline is added. Which approach should the engineer use?
  • A. Enable AWS KMS multi-Region keys and replicate the key to the CodeBuild account
  • B. Create a KMS grant that authorizes the CodeBuild service role to use the key Correct answer
  • C. Copy the customer managed key into the CodeBuild account using AWS Backup
  • D. Add an explicit Allow statement for the account root user in the key policy

Option B is correct because a KMS grant lets a key owner authorize a specific principal, like the CodeBuild service role, to use the key for defined operations without editing the key policy for every new pipeline. Multi-Region key replication, AWS Backup copies, and root-user allow statements do not solve the recurring per-pipeline authorization problem.

A company uses AWS CodePipeline in a central tooling account to deploy AWS CloudFormation stacks into a separate production account. Which approach lets the pipeline deploy into the production account without storing long-term credentials for that account in the tooling account?
  • A. Assume an IAM role in the production account using a cross-account trust policy Correct answer
  • B. Create an IAM user in the production account and share its console password
  • C. Replicate the tooling account's IAM users into the production account
  • D. Store an IAM user access key for the production account in AWS Secrets Manager

Option A is correct because assuming a role in the production account through a cross-account trust policy issues temporary credentials, avoiding any long-term secret storage in the tooling account. Sharing an IAM user's password, replicating IAM users, or storing an access key in Secrets Manager all keep long-lived credentials in play.

Configuration Management and IaC

A platform engineering team wants AWS CloudFormation to reject a stack deployment before any resources are created if the template would provision a publicly accessible Amazon RDS instance, rather than detecting and remediating it afterward. Which AWS Config capability enables this pre-deployment check?
  • A. A proactive AWS Config rule evaluated during CloudFormation hooks Correct answer
  • B. An AWS Config aggregator monitoring the CloudFormation stack
  • C. A CloudFormation drift detection report run nightly
  • D. A detective AWS Config rule evaluated after resource creation

Option A is correct because a proactive AWS Config rule evaluated through CloudFormation hooks runs before resources are provisioned and can block a non-compliant stack deployment outright. Aggregators, drift detection, and detective rules all evaluate resources only after they already exist.

A cloud governance team wants to prevent any AWS resource from being created in the organization without a CostCenter tag, and wants the enforcement itself, not just a report, to happen automatically at creation time in supported services. Which AWS Organizations feature should the team use?
  • A. A cost allocation tag report reviewed weekly by finance
  • B. A tag policy with the service's tag-on-create enforcement Correct answer
  • C. An AWS Config rule that flags untagged resources daily
  • D. An SCP that denies all actions for every principal

Option B is correct because an AWS Organizations tag policy with tag-on-create enforcement blocks the creation of a resource in supported services if it lacks the required tag, enforcing the rule automatically rather than just reporting on it. A weekly cost report and a daily Config rule only detect after the fact, and a blanket SCP denying all actions would break normal operations.

Which TWO statements about Amazon EventBridge Scheduler are correct? (Choose two.)
  • A. It removes the need for an IAM role on the target
  • B. It can invoke targets on a one-time or recurring basis Correct answer
  • C. It supports only cron expressions, not rate expressions
  • D. It supports a flexible time window to spread out invocation start times Correct answer
  • E. It requires every target to be a Lambda function

Options B and D are correct because EventBridge Scheduler can invoke targets either once or on a recurring schedule, and it supports a flexible time window that spreads out invocation start times to smooth bursts of concurrent executions. It still requires an IAM role for the target (A), it supports both cron and rate expressions rather than only cron (C), and targets aren't limited to Lambda functions (E), since Scheduler supports a broad set of target types.

A logistics platform runs separate pipelines for its order and inventory services, both deploying to the same VPC. The team wants a shared library of custom pipeline actions and reusable CodeBuild buildspecs maintained in one place and consumed by both pipelines. Which THREE practices support this without duplicating logic? (Choose three.)
  • A. Store one team's buildspec directly inside the other team's Lambda function code
  • B. Publish shared buildspec fragments and scripts as a versioned package consumed by each project Correct answer
  • C. Grant the inventory pipeline direct write access to the order service's source repository
  • D. Reference a shared CodeBuild project across both pipelines with per-service environment variables Correct answer
  • E. Define reusable CloudFormation modules or CDK constructs for the common pipeline shape Correct answer
  • F. Copy and paste the buildspec into every repository so each team can edit it freely

Options B, D, and E are correct because publishing shared buildspec fragments as a versioned package, referencing one CodeBuild project across pipelines with per-service environment variables, and defining reusable CloudFormation modules or CDK constructs all centralize the shared logic in one maintained place that both pipelines consume. Option A (embedding one team's buildspec in another team's Lambda code), Option C (cross-team write access to the other service's repo), and Option F (copy-pasting the buildspec everywhere) all create duplication or unrelated coupling instead of reuse.

Resilient Cloud Solutions

A database administrator configures an Amazon RDS for PostgreSQL instance for high availability. Which feature automatically provisions a standby instance in a different Availability Zone and performs an automatic failover if the primary instance becomes unavailable?
  • A. Create a read replica in another Availability Zone
  • B. Switch the engine to Aurora Serverless v2
  • C. Copy automated snapshots to another Region
  • D. Enable a Multi-AZ deployment Correct answer

Option D is correct because enabling a Multi-AZ deployment for RDS PostgreSQL automatically provisions a synchronously replicated standby in a different Availability Zone and performs an automatic failover to it if the primary becomes unavailable. A read replica (A) replicates asynchronously and requires manual promotion, Aurora Serverless v2 (B) is a compute option unrelated to standard RDS Multi-AZ failover, and cross-Region snapshot copy (C) only protects against disaster scenarios, not automatic failover.

A development team runs a web tier behind an Application Load Balancer with an Auto Scaling group. Which Auto Scaling policy type adjusts capacity to keep a chosen CloudWatch metric, such as average CPU utilization, at a specified target value?
  • A. Target tracking scaling policy Correct answer
  • B. Step scaling policy
  • C. Scheduled scaling policy
  • D. Simple scaling policy

Option A is correct because a target tracking scaling policy automatically adjusts capacity to keep a chosen CloudWatch metric, like average CPU utilization, at a specified target value. Step scaling (B) and simple scaling (D) react to alarm breaches with fixed capacity adjustments rather than holding a metric at a target, and scheduled scaling (C) changes capacity on a time-based schedule rather than in response to a metric at all.

Which TWO troubleshooting techniques would help determine whether a slow API response is caused by cold-start latency in a Lambda-backed API rather than by the application logic itself? (Choose two.)
  • A. Check the Route 53 DNS resolution time
  • B. Check whether provisioned concurrency is configured for the function Correct answer
  • C. Compare the Init Duration reported in the Lambda REPORT log line Correct answer
  • D. Review the CloudFront cache hit ratio
  • E. Review the API Gateway usage plan throttle limits

Options B and C are correct because checking whether provisioned concurrency is configured for the function reveals whether cold starts should be occurring at all, and comparing the Init Duration reported in the Lambda REPORT log line directly shows how much of a given invocation's time was spent on cold-start initialization versus actual handler execution. Route 53 DNS resolution time (A), CloudFront cache hit ratio (D), and API Gateway throttle limits (E) are all unrelated to Lambda's own cold-start behavior.

Monitoring and Logging

A compliance auditor asks how far back an account can view a record of management API calls when the account has never had an AWS CloudTrail trail explicitly created. What is the default retention period for this activity in the CloudTrail Event history view?
  • A. 7 days
  • B. 90 days Correct answer
  • C. 180 days
  • D. 365 days

Option B is correct because CloudTrail Event history retains the last 90 days of management events by default even when no trail has ever been created. The other durations do not match this documented default.

A gaming company sees highly unpredictable, spiky traffic against a DynamoDB table that holds player session state, with no reliable pattern to size provisioned throughput against. Which change lets the table absorb the spikes without capacity planning or scaling policies?
  • A. Switch the table to on-demand capacity mode Correct answer
  • B. Raise provisioned write capacity units to the account maximum
  • C. Add a DynamoDB Accelerator (DAX) cluster
  • D. Enable DynamoDB auto scaling with a wide target range

Option A is correct because DynamoDB on-demand capacity mode automatically scales to absorb unpredictable, spiky traffic without any capacity planning or scaling policies. Raising provisioned capacity to the maximum (B) still requires planning and caps throughput at a fixed ceiling, adding DAX (C) only accelerates reads and does not address write capacity planning, and auto scaling (D) still relies on provisioned capacity and scaling policies reacting to utilization, which lags behind sudden spikes.

Which TWO of the following are valid Amazon SNS subscription protocols for delivering alarm notifications directly to an on-call engineer? (Choose two.)
  • A. S3 event notification
  • B. SMS Correct answer
  • C. Email Correct answer
  • D. DynamoDB Streams
  • E. Kinesis Data Streams

Options B and C are correct because SMS and Email are both valid Amazon SNS subscription protocols capable of delivering an alarm notification directly to a person. S3 event notification (A) is a trigger source unrelated to SNS subscription protocols, and DynamoDB Streams (D) and Kinesis Data Streams (E) are data streaming services, not SNS subscriber endpoints.

Incident and Event Response

A development team notices that an Amazon ECS service repeatedly fails its container health check shortly after deployment. Which log source should the team check first to identify the immediate cause?
  • A. VPC flow logs for the subnet
  • B. ECS task definition JSON
  • C. Container logs in CloudWatch Logs Correct answer
  • D. AWS Trusted Advisor check results

Option C is correct because container logs in CloudWatch Logs capture the application's own startup and runtime output, which is the fastest way to see why a container is failing its health check. VPC flow logs (A) only show network traffic, the task definition JSON (B) describes configuration rather than runtime behavior, and Trusted Advisor (D) doesn't monitor container health at all.

A retail platform wants an AWS Lambda function invoked automatically whenever a specific API call appears in CloudTrail. Which feature enables this?
  • A. A CloudWatch Logs metric filter
  • B. A CloudWatch Contributor Insights rule
  • C. An EventBridge rule matching the API call Correct answer
  • D. A CloudWatch anomaly detection alarm

Option C is correct because an EventBridge rule with an event pattern matching the specific CloudTrail API call can invoke a Lambda function automatically whenever that call occurs. A CloudWatch Logs metric filter (A) and Contributor Insights rule (B) work on log data rather than individual API calls, and an anomaly detection alarm (D) reacts to metric behavior, not a specific API call.

Which TWO AWS services can act as a direct target of an Amazon EventBridge rule without requiring an intermediate Lambda function? (Choose two.)
  • A. AWS Step Functions Correct answer
  • B. Amazon RDS Performance Insights
  • C. A CloudWatch Logs Insights saved query
  • D. Amazon SQS Correct answer
  • E. AWS X-Ray

Options A and D are correct because AWS Step Functions and Amazon SQS are both natively supported as direct EventBridge rule targets, requiring no Lambda function in between. RDS Performance Insights (B) and AWS X-Ray (E) aren't valid EventBridge targets at all, and a CloudWatch Logs Insights saved query (C) is a stored query definition, not an invokable target.

Security and Compliance

A media company grants a contractor temporary read access to objects in an Amazon S3 bucket for a two-day project and wants to avoid creating a long-term IAM user or distributing access keys. Which AWS capability should the company use to issue short-lived, scoped credentials to the contractor?
  • A. AWS Organizations service control policies
  • B. An IAM user with an access key rotated weekly
  • C. AWS Security Token Service AssumeRole Correct answer
  • D. Amazon Cognito identity pools for federated end users

Option C is correct because AWS STS AssumeRole issues short-lived, scoped temporary credentials that expire automatically, which is exactly the mechanism for granting a contractor temporary access without a long-term IAM user. Options B and D either create a standing identity or key, and A (SCPs) only sets permission guardrails rather than issuing credentials.

A DevOps team stores a database password in AWS Secrets Manager and wants Secrets Manager to generate a new password and update the database on a schedule using only the built-in rotation template, without writing custom orchestration. Which AWS service actually executes the rotation logic?
  • A. Amazon EventBridge Scheduler rules
  • B. AWS Lambda Correct answer
  • C. AWS Step Functions state machines
  • D. AWS Systems Manager Automation documents

Option B is correct because AWS Secrets Manager's built-in rotation templates run as an AWS Lambda function that actually performs the create/set/test/finish steps against the database. EventBridge Scheduler, Step Functions, and SSM Automation are not what the built-in rotation template invokes.

A security analyst is building automated detection for anomalous IAM activity across an organization and wants to distinguish which findings come from statistical baselining of API call volume versus which come from matching known threat-intelligence indicators. Which TWO statements correctly describe the underlying detection approach of each service?
  • A. Both services only evaluate data stored in S3 access logs
  • B. GuardDuty correlates activity against threat intelligence feeds and anomalous behavior models Correct answer
  • C. CloudTrail Insights baselines normal API call volume and flags statistical deviation from it Correct answer
  • D. GuardDuty requires a manually written detection rule for every finding type
  • E. CloudTrail Insights blocks the anomalous API call before it executes

Options B and C are correct because GuardDuty correlates activity against threat-intelligence feeds and anomaly-detection models, while CloudTrail Insights specifically baselines normal API call volume and flags statistical deviations from it. Option A is false since neither service is limited to S3 access logs, D is false because GuardDuty's detections are built-in rather than manually written per finding, and E is false because CloudTrail Insights only flags anomalies after the fact rather than blocking calls.

Free Study Guide

Read the free AWS DOP-C02 study guide: every exam topic explained in plain English, with diagrams, exam tips and the mistakes to avoid.

More AWS Practice Exams

All AWS practice exams →

Practice with realistic mock exams to prepare for your AWS certification.