Docsity

AWS DevOps Engineer Professional Exam Prep 2026 Comprehensive DevOps Cloud Certification, Exams of Engineering

Toggle sidebar
bg1
AWS DevOps Engineer Professional Exam Prep 2026
Comprehensive DevOps Cloud Certification Review
Practice Questions with Detailed Rationales
EXAM OVERVIEW
The AWS Certified DevOps Engineer – Professional (DOP-C02) exam features:
Attribute
Details
Exam code
DOP-C02
Level
Professional
Number of questions
65-75 (multiple-choice and multiple-response)
Time limit
180 minutes
Passing score
750 out of 1000
Exam fee
Approximately $300 USD
Validity
3 years
DOMAIN 1: SDLC AUTOMATION (22%) — Questions 1-22
Question 1
A company has a mission-critical application deployed across multiple AWS
accounts using AWS CodePipeline. The DevOps engineer needs to implement a
deployment strategy that gradually shifts traffic to a new version while providing
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31

Partial preview of the text

Download AWS DevOps Engineer Professional Exam Prep 2026 Comprehensive DevOps Cloud Certification and more Exams Engineering in PDF only on Docsity!

AWS DevOps Engineer Professional Exam Prep 2026

Comprehensive DevOps Cloud Certification Review

Practice Questions with Detailed Rationales

EXAM OVERVIEW

The AWS Certified DevOps Engineer – Professional (DOP-C02) exam features: Attribute Details Exam code DOP-C Level Professional Number of questions 65 - 75 (multiple-choice and multiple-response) Time limit 180 minutes Passing score 750 out of 1000 Exam fee Approximately $300 USD Validity 3 years DOMAIN 1: SDLC AUTOMATION (22%) — Questions 1- 22 Question 1 A company has a mission-critical application deployed across multiple AWS accounts using AWS CodePipeline. The DevOps engineer needs to implement a deployment strategy that gradually shifts traffic to a new version while providing

automatic rollback if errors exceed a threshold. Which combination of services and deployment configuration should the engineer use? A) CodeDeploy with Linear10PercentEvery1Minute deployment configuration and CloudWatch alarm rollback B) CodeDeploy with Canary10Percent5Minutes deployment configuration and CloudWatch alarm rollback C) CodePipeline with manual approval gates and S3 artifact versioning D) Elastic Beanstalk with rolling update policy and enhanced health reporting Answer: B Rationale: CodeDeploy's canary deployment strategy with Canary10Percent5Minutes gradually shifts traffic (10% initially, then the remainder after 5 minutes) and supports automatic rollback when CloudWatch alarms are triggered. This provides the controlled traffic shifting with automated rollback capabilities required for mission-critical applications. Option A uses a linear strategy which shifts traffic evenly over time without a canary testing phase. Option C lacks automated traffic shifting and rollback. Option D is not appropriate for multi-account CodePipeline deployments. Question 2 A DevOps engineer is building a CI/CD pipeline using AWS CodePipeline. The pipeline has a source stage (CodeCommit), a build stage (CodeBuild), and a deploy stage (CodeDeploy). The engineer needs to ensure that only artifacts that have passed all unit and integration tests are promoted to production. What is the MOST appropriate way to implement this requirement? A) Run all tests in the CodeBuild build stage and fail the build if any test fails B) Add a test stage after the build stage with CodeBuild actions that run tests and conditionally gate promotion C) Use CodePipeline's manual approval action after the build stage D) Configure CodeDeploy to run tests during the BeforeInstall lifecycle hook Answer: B Rationale: Adding a separate test stage in CodePipeline with CodeBuild actions that run tests provides clear separation of concerns and allows for conditional promotion based on test results. This approach makes the pipeline more

Answer: B Rationale: CodeBuild caching significantly improves build performance by storing frequently used dependencies between builds, reducing network downloads and build time. Increasing compute type (Option A) may help but doesn't address the network timeout issue. VPC with NAT gateway (Option C) could actually add latency. Parallel build phases (Option D) are not a standard CodeBuild feature. Question 5 A company has a three-tier application deployed on Amazon ECS with Fargate. The DevOps engineer needs to implement a blue/green deployment strategy that minimizes risk and provides instant rollback capability. Which combination of AWS services should be used? A) CodeDeploy with ECS blue/green deployment and CloudWatch alarm rollback B) ECS service with rolling update and CloudWatch alarm rollback C) CodePipeline with ECS deploy action and manual rollback D) AWS CloudFormation with update replacement policy Answer: A Rationale: CodeDeploy provides native blue/green deployment support for Amazon ECS, creating a new task set (green) while the existing task set (blue) continues serving traffic. It supports automatic rollback based on CloudWatch alarms and provides instant rollback by switching traffic back to the original task set. Option B uses rolling updates which don't provide the same traffic shifting control. Option C lacks automated rollback. Option D is not suitable for ECS deployments. Question 6 A DevOps engineer is reviewing a CodePipeline that has been failing intermittently during the build stage. The failure logs show that the CodeBuild project is unable to download artifacts from S3. What is the MOST likely cause of this issue? A) The S3 bucket is in a different region from the CodeBuild project B) The CodeBuild service role does not have s3:GetObject permission for the artifact bucket

C) The artifact encryption key is not accessible D) The S3 bucket has a lifecycle policy that deleted the artifacts Answer: B Rationale: The CodeBuild service role must have appropriate permissions to access S3 artifacts. The most likely cause is missing s3:GetObject permissions on the artifact bucket. While S3 cross-region access (Option A) is possible, it's not the most likely cause. Encryption key issues (Option C) would produce a different error. Lifecycle policies (Option D) would cause artifacts to be missing entirely. Question 7 A company needs to implement a CI/CD pipeline that deploys a microservice to a Kubernetes cluster running on Amazon EKS. The pipeline should validate the Kubernetes manifests before deployment. Which AWS services should be used to implement this? A) CodePipeline, CodeBuild (with kubeval or kubeconform), and kubectl deploy B) CodePipeline, CodeDeploy (ECS deployment), and EKS C) CodePipeline, CodeBuild, and Helm with CodeArtifact D) AWS Proton and CodePipeline Answer: A Rationale: CodePipeline orchestrates the pipeline, CodeBuild can run manifest validation tools like kubeval or kubeconform during the build stage, and then apply the manifests using kubectl. CodeDeploy (Option B) is for ECS, not EKS. Helm (Option C) is useful but kubeval is the standard for manifest validation. AWS Proton (Option D) is a higher-level service for infrastructure provisioning. Question 8 A DevOps engineer is implementing a deployment pipeline for a serverless application using AWS SAM. The engineer needs to deploy to multiple environments (dev, staging, production) with different configuration values. What is the BEST approach to manage environment-specific configurations? A) Use separate template.yaml files for each environment B) Use SAM parameter-overrides with environment-specific parameter files

A) Store artifacts in a cross-account S3 bucket with bucket policies B) Use AWS CodeArtifact with cross-account repository access C) Sign artifacts with GPG and verify signatures during deployment D) Use AWS KMS to encrypt artifacts and share the key across accounts Answer: C Rationale: Signing artifacts with GPG and verifying signatures during deployment provides integrity verification across accounts. This ensures artifacts haven't been tampered with during the cross-account transfer. Cross-account S3 (Option A) provides storage but not integrity verification. CodeArtifact (Option B) is for package management, not build artifacts. KMS encryption (Option D) protects confidentiality but not integrity. Question 11 A company is using AWS CodePipeline with a GitHub source action. The pipeline needs to trigger on pull request creation and automatically build and deploy to a preview environment. Which CodePipeline feature should be used? A) GitHub webhooks configured in CodePipeline B) Scheduled pipeline triggers C) Manual pipeline execution D) Polling source action with CloudWatch Events Answer: A Rationale: CodePipeline supports webhooks from GitHub to trigger pipeline execution on specific events, including pull request creation. Scheduled triggers (Option B) don't support pull request events. Manual execution (Option C) defeats automation. Polling (Option D) is inefficient and doesn't provide immediate triggers. Question 12 A DevOps engineer is troubleshooting a CodeDeploy deployment that is stuck in the "In Progress" state. The deployment logs show that the ApplicationStart lifecycle hook script is not completing. What is the MOST appropriate action to resolve this issue?

A) Increase the CodeDeploy deployment timeout B) Check the script for infinite loops or hanging processes C) Restart the CodeDeploy agent on the instance D) Roll back the deployment manually Answer: B Rationale: When a lifecycle hook script hangs, the most likely cause is an infinite loop, a hanging process, or a command that waits indefinitely. The engineer should examine the script and fix the underlying issue. Increasing the timeout (Option A) only masks the problem. Restarting the agent (Option C) may temporarily resolve but doesn't fix the root cause. Manual rollback (Option D) loses the deployment history. Question 13 A company is implementing a CI/CD pipeline for a monolithic application that takes 45 minutes to build and test. The DevOps engineer wants to reduce the feedback loop for developers. Which approach would MOST effectively reduce build time? A) Use a larger CodeBuild compute type B) Implement parallel test execution in CodeBuild C) Split the application into microservices with independent pipelines D) Cache dependencies and use incremental builds Answer: D Rationale: Caching dependencies and implementing incremental builds (building only changed components) provides the most significant and sustainable build time reduction. While larger compute (Option A) may help, it has diminishing returns. Parallel test execution (Option B) helps but doesn't address the build time. Splitting into microservices (Option C) is a significant architectural change that may not be feasible. Question 14 A DevOps engineer is configuring a CodePipeline cross-account deployment. The source artifacts are in Account A, and the deployment target is in Account B. What is the correct cross-account setup?

to Amazon ECR. The build is failing with a "no space left on device" error. What is the MOST appropriate solution? A) Increase the CodeBuild compute type to a larger instance B) Use a Docker layer cache and clean up intermediate images C) Store the Docker image in S3 instead of ECR D) Use AWS CodeBuild's local cache feature Answer: B Rationale: Docker builds create intermediate layers that consume disk space. Using layer caching and cleaning up intermediate images (docker system prune) reduces disk usage. Increasing compute type (Option A) may help but doesn't address inefficient Docker build practices. Storing in S3 (Option C) is not appropriate for container images. Local cache (Option D) helps with build speed but not disk space. Question 17 A company wants to implement a CI/CD pipeline that deploys infrastructure using AWS CloudFormation before deploying the application. The engineer needs to ensure that the infrastructure deployment is validated before the application deployment begins. Which CodePipeline action type should be used? A) CodeBuild action with CloudFormation commands B) CloudFormation action with ChangeSet and ExecuteChangeSet C) Lambda action invoking CloudFormation APIs D) CodeDeploy action for infrastructure Answer: B Rationale: CodePipeline has native CloudFormation actions that support ChangeSet creation and execution. Using ChangeSets allows validation of infrastructure changes before execution, ensuring the application deployment only proceeds after successful infrastructure deployment. CodeBuild with CloudFormation (Option A) is less integrated. Lambda (Option C) adds unnecessary complexity. CodeDeploy (Option D) is for application deployment.

Question 18 A DevOps engineer is implementing a deployment pipeline for a Lambda function. The function needs to be deployed using CodeDeploy with traffic shifting. Which CodeDeploy configuration is appropriate for Lambda deployments? A) CodeDeployDefault.LambdaLinear10PercentEvery1Minute B) CodeDeployDefault.LambdaAllAtOnce C) CodeDeployDefault.LambdaCanary10Percent5Minutes D) All of the above Answer: D Rationale: CodeDeploy supports multiple deployment configurations for Lambda, including linear, canary, and all-at-once. The choice depends on the specific requirements for traffic shifting and rollback capabilities. All options are valid Lambda deployment configurations. Question 19 A company is using AWS CodePipeline with a GitHub source action. The pipeline is triggering on every commit to the main branch, but the DevOps engineer wants to trigger the pipeline only when specific files change (e.g., the src/ directory). Which approach should be used? A) Use GitHub's path filtering with webhooks B) Use CodePipeline's polling with file filters C) Use a CodeBuild action to check file changes early in the pipeline D) Use multiple source actions for different directories Answer: A Rationale: GitHub webhooks support path filtering, allowing triggers only when files in specific paths change. CodePipeline's polling (Option B) doesn't support file filters. Checking in a CodeBuild action (Option C) would run the pipeline unnecessarily. Multiple source actions (Option D) is more complex and doesn't achieve the filtering goal. Question 20 A DevOps engineer is reviewing a CodePipeline that has been failing with a "stage

CodeArtifact during the build. What is the correct way to configure CodeBuild to authenticate with CodeArtifact? A) Store CodeArtifact credentials in CodeBuild environment variables B) Use the aws codeartifact login command in the pre_build phase C) Use IAM roles with the codeartifact:GetAuthorizationToken permission D) Use AWS Secrets Manager to store CodeArtifact tokens Answer: C Rationale: CodeBuild should use an IAM role with codeartifact:GetAuthorizationToken permission to authenticate with CodeArtifact. CodeBuild automatically uses the instance profile credentials. Storing credentials in environment variables (Option A) is a security risk. The aws codeartifact login command (Option B) is for local development. Secrets Manager (Option D) adds unnecessary complexity. DOMAIN 2: CONFIGURATION MANAGEMENT AND IAC (17%) — Questions 23- 39 Question 23 A company uses AWS CloudFormation to manage infrastructure across 50 AWS accounts. The DevOps engineer needs to deploy a common baseline (e.g., IAM roles, security groups, logging configuration) to all accounts. Which CloudFormation feature should be used? A) Nested stacks B) CloudFormation StackSets C) Cross-stack references D) CloudFormation modules Answer: B Rationale: CloudFormation StackSets are designed for deploying stacks across multiple accounts and regions. They provide centralized management of infrastructure across the organization. Nested stacks (Option A) are for modularizing within a single stack. Cross-stack references (Option C) are for

sharing resources between stacks in the same account. Modules (Option D) are for reusable template components. Question 24 A DevOps engineer is using AWS CloudFormation to manage infrastructure. The engineer notices that manual changes have been made to a stack's resources, causing the stack to be out of sync with the template. What CloudFormation feature should be used to detect this? A) Stack policies B) Change sets C) Drift detection D) Stack termination protection Answer: C Rationale: Drift detection identifies differences between the stack's actual configuration and the template. Stack policies (Option A) prevent updates to specific resources. Change sets (Option B) preview changes before applying them. Termination protection (Option D) prevents accidental deletion. Question 25 A company is using AWS CloudFormation to deploy a complex application with multiple components. The DevOps engineer wants to reuse common infrastructure patterns across multiple stacks. Which CloudFormation feature should be used? A) Nested stacks B) CloudFormation modules C) StackSets D) Resource imports Answer: B Rationale: CloudFormation modules are reusable template components that encapsulate common infrastructure patterns. They can be published to a registry and reused across stacks. Nested stacks (Option A) are for composing stacks but don't provide the same reusability. StackSets (Option C) are for multi-account

Question 28 A DevOps engineer is implementing configuration management for EC2 instances using AWS Systems Manager. The engineer needs to apply a configuration (e.g., install a specific package) to a fleet of instances and ensure it remains in the desired state. Which Systems Manager feature should be used? A) Systems Manager Run Command B) Systems Manager State Manager C) Systems Manager Patch Manager D) Systems Manager Automation Answer: B Rationale: State Manager is a Systems Manager capability that maintains desired configuration states for managed instances. It applies configurations and automatically corrects drift. Run Command (Option A) executes commands once. Patch Manager (Option C) is specifically for patching. Automation (Option D) is for complex workflows. Question 29 A company is using AWS CloudFormation StackSets to deploy infrastructure to multiple accounts. The DevOps engineer needs to deploy a stack to all accounts in an AWS Organization except for the management account. Which StackSets deployment option should be used? A) Deploy to all accounts in the organization B) Deploy to specific accounts C) Deploy to organizational units (OUs) excluding the management account D) Deploy with account exclusion using StackSets parameters Answer: C Rationale: StackSets can deploy to organizational units (OUs), allowing exclusion of the management account by deploying only to OUs containing member accounts. Deploying to all accounts (Option A) would include the management account. Specific accounts (Option B) would require manual maintenance. Account exclusion through parameters (Option D) is not a native StackSets feature.

Question 30 A DevOps engineer is using AWS CloudFormation to deploy a stack that includes an IAM role. The stack fails to delete because the IAM role is still in use. What is the MOST appropriate solution? A) Force delete the stack using the CLI B) Delete the IAM role manually before deleting the stack C) Use a stack policy to allow deletion of the IAM role D) Use CloudFormation's DeletionPolicy attribute with Retain Answer: B Rationale: When an IAM role is still in use (e.g., by an EC2 instance profile), CloudFormation cannot delete it. The engineer should identify what is using the role and remove the dependency before stack deletion. Force deletion (Option A) can leave resources orphaned. Stack policies (Option C) protect resources from updates, not deletion. DeletionPolicy: Retain (Option D) would keep the role, not help with deletion. Question 31 A company is using AWS Systems Manager Parameter Store to manage configuration. The DevOps engineer needs to share a parameter with another AWS account. What is the correct approach? A) Make the parameter public B) Use cross-account IAM roles with KMS key sharing for SecureString parameters C) Export the parameter to an S3 bucket D) Use AWS AppConfig for cross-account sharing Answer: B Rationale: For SecureString parameters, cross-account sharing requires sharing the KMS key used for encryption and granting IAM permissions to the other account. Making parameters public (Option A) is insecure. S3 export (Option C) creates synchronization issues. AppConfig (Option D) is for application configuration, not parameter sharing.

configuration. The engineer needs to apply Chef recipes to instances during the setup lifecycle event. Which OpsWorks lifecycle event should be used? A) setup B) configure C) deploy D) undeploy Answer: A Rationale: The setup lifecycle event in OpsWorks runs when an instance is first started. configure (Option B) runs when the stack configuration changes. deploy (Option C) runs during application deployment. undeploy (Option D) runs during application removal. Question 35 A company is using AWS CloudFormation to deploy a stack with multiple resources. The DevOps engineer wants to prevent accidental updates to certain resources (e.g., RDS database) while allowing updates to others. Which CloudFormation feature should be used? A) Stack termination protection B) Stack policies C) Resource policies D) Change sets Answer: B Rationale: Stack policies are JSON documents that define the update actions that can be performed on specific resources. They prevent updates to critical resources while allowing others. Termination protection (Option A) prevents deletion only. Resource policies (Option C) are for IAM. Change sets (Option D) preview changes but don't prevent them. Question 36 A DevOps engineer is using AWS Systems Manager Automation to implement a runbook for incident response. The runbook needs to execute a series of steps with conditional logic. Which Systems Manager Automation feature should be used?

A) aws:executeScript with Python B) aws:branch for conditional execution C) Multiple Automation documents chained together D) aws:waitForAwsResourceProperty for polling Answer: B Rationale: aws:branch allows conditional execution of Automation steps based on the output of previous steps. aws:executeScript (Option A) runs scripts but doesn't provide native branching. Chaining documents (Option C) is complex. aws:waitForAwsResourceProperty (Option D) is for waiting on resource states. Question 37 A company is using AWS CloudFormation with the AWS CDK to define infrastructure. The DevOps engineer needs to deploy a stack that creates resources that depend on each other. How does the CDK handle resource dependencies? A) Resources are created in the order they are defined in the code B) The CDK automatically determines dependencies based on resource references C) The engineer must manually specify dependencies using the dependsOn property D) Resources are created in parallel regardless of dependencies Answer: B Rationale: The AWS CDK automatically analyzes resource references to determine dependencies. When one resource references another (e.g., a security group referencing a VPC), the CDK synthesizes the appropriate CloudFormation dependencies. Manual dependsOn (Option C) is only needed for implicit dependencies. Question 38 A DevOps engineer is using AWS AppConfig to manage feature flags for an application. The engineer needs to deploy a new feature flag configuration without disrupting existing users. Which AppConfig deployment strategy should be used?