Courseiva

AWS Certified DevOps Engineer Professional DOP-C02 (DOP-C02) — Questions 751–825

1298 questions total · 18pages · All types, answers revealed

Page 10

Page 11 of 18

Page 12
751
MCQeasy

A company is designing a disaster recovery strategy for its primary RDS for PostgreSQL database in us-east-1. The RTO is 15 minutes and RPO is 1 minute. Which solution meets these requirements?

A.Create a cross-Region read replica in the secondary Region and promote it during failover.
B.Use AWS Backup to copy automated backups to the secondary Region every hour.
C.Deploy a Multi-AZ RDS instance and failover to the standby in the same region.
D.Take manual snapshots of the database every 5 minutes and copy them to the secondary Region.
AnswerA

A cross-Region read replica in RDS for MySQL, MariaDB, or PostgreSQL uses engine-native asynchronous replication to continuously stream changes from the primary in the source Region to a replica instance in the secondary Region. During a failover, you simply promote the replica, which stops replication and makes it a standalone primary database; promotion typically completes in minutes, giving you an RTO in minutes and an RPO of only seconds (or sub-second in low-write workloads). Because replication is ongoing rather than backup-based, this option gives the lowest RPO and RTO among the choices and is the correct DR strategy for cross-Region recovery.

Why this answer

A cross-Region read replica can be promoted to a primary instance in a matter of minutes, meeting the 15-minute RTO, and replication lag is typically under 1 minute, satisfying the 1-minute RPO. Option B (AWS Backup every hour) provides an RPO of up to 1 hour, exceeding the requirement. Option C (Multi-AZ in same region) does not provide cross-Region failover.

Option D (manual snapshots every 5 minutes) has a higher RPO than 1 minute and may not be promotable quickly enough.

752
MCQmedium

A company's DevOps team uses AWS CodePipeline to automate deployments. A recent pipeline execution failed at the 'Deploy' stage. The engineer needs to view the detailed logs for the failed action. Which AWS service or feature should the engineer use?

A.CloudWatch Logs
B.S3 access logs
C.CodeBuild logs
D.CloudTrail
AnswerA

CodePipeline natively publishes execution-level log events to Amazon CloudWatch Logs, including stage start/end timestamps, action state transitions, and failure diagnostics. This provides a centralized, queryable repository that can be filtered with CloudWatch Logs Insights, used for metric filters and alarms, and retained beyond the console's default history. Because these logs capture the pipeline's own runtime behavior, they are the authoritative source for troubleshooting execution details.

Why this answer

AWS CodePipeline integrates with Amazon CloudWatch Logs to capture and store detailed execution logs for each pipeline action, including the 'Deploy' stage. When a deployment action fails, the engineer can view the associated logs directly from the CodePipeline console or via the CloudWatch Logs console, which provides granular error messages, timestamps, and stack traces necessary for troubleshooting. This is the designated service for accessing action-level logs in CodePipeline.

Exam trap

The trap here is that candidates may confuse CloudTrail (audit logs) with CloudWatch Logs (operational logs), or assume that CodeBuild logs cover all pipeline stages, when in fact each stage type (e.g., Deploy) has its own log destination.

How to eliminate wrong answers

Option B (S3 access logs) is wrong because S3 access logs record requests made to an S3 bucket, not the execution logs of CodePipeline actions. Option C (CodeBuild logs) is wrong because CodeBuild logs are specific to build actions within CodePipeline, not to deploy actions, which may use other providers like CodeDeploy or Elastic Beanstalk. Option D (CloudTrail) is wrong because CloudTrail records API calls made to AWS services for auditing purposes, not the detailed runtime logs of a pipeline execution.

753
MCQmedium

A company uses Amazon CloudWatch Logs to store application logs. A DevOps engineer needs to create a real-time dashboard that displays the count of ERROR-level log entries across all instances. Which approach is the MOST efficient and cost-effective?

A.Create a CloudWatch Logs metric filter for each log group to count ERROR entries, and then create a CloudWatch dashboard
B.Use CloudWatch Logs Insights to run a query that counts ERROR entries across all log groups and add the query to a CloudWatch dashboard
C.Export logs to Amazon S3 and use Amazon Athena to query and visualize in Amazon QuickSight
D.Create a Kinesis Data Firehose delivery stream to stream logs to Amazon OpenSearch Service and build a dashboard in OpenSearch Dashboards
AnswerB

CloudWatch Logs Insights runs a query like `fields @timestamp, @logGroup | filter @message like /ERROR/ | stats count(*) by @logGroup` across all specified log groups in the selected time range, and the exact same query can be added as a dashboard widget using the 'Add to dashboard' option. This gives real-time results without any per-group configuration, and the dashboard automatically reflects the current set of log groups as long as they are included in the query scope. It is the intended native mechanism for interactive multi-group log analysis, making it the correct choice for this scenario.

Why this answer

CloudWatch Logs Insights allows you to run a query across all log groups in real time using a single query, and you can add that query directly to a CloudWatch dashboard. This approach is both efficient (no need to create per-log-group metric filters) and cost-effective (you pay only for the data scanned by the query, not for ongoing metric filter evaluation).

Exam trap

The trap here is that candidates often assume metric filters (Option A) are the only native way to get counts into a dashboard, overlooking that CloudWatch Logs Insights queries can be embedded directly into dashboards for real-time, cross-log-group analysis without the overhead of per-group filters.

How to eliminate wrong answers

Option A is wrong because creating a metric filter for each log group incurs ongoing costs for each filter evaluation, and managing filters across many log groups is inefficient compared to a single cross-group query. Option C is wrong because exporting logs to S3 and using Athena/QuickSight introduces latency (logs are not real-time) and additional costs for S3 storage, Athena queries, and QuickSight subscriptions, making it less efficient and more expensive for a real-time dashboard. Option D is wrong because streaming logs to OpenSearch Service via Kinesis Data Firehose adds complexity, latency, and cost for the delivery stream, OpenSearch cluster, and dashboard, which is overkill for a simple count of ERROR entries.

754
MCQeasy

A company runs a production web application on EC2 instances behind an Application Load Balancer. The application experiences intermittent high latency. The operations team needs to identify the root cause without affecting live traffic. Which approach is the MOST efficient?

A.Deploy a separate test environment with identical configuration and run load tests
B.Enable EC2 detailed monitoring and SSH into each instance to run top and iostat
C.Enable detailed CloudWatch metrics on the ALB and analyze ALB access logs
D.Run tcpdump on all EC2 instances and analyze packet captures
AnswerC

Enabling detailed CloudWatch metrics on the ALB provides high-frequency measurements such as TargetResponseTime, RequestCount, and TargetConnectionErrorCount, and analyzing ALB access logs offers per-request timestamps, target processing time, request time, client IP, and target status codes. This combination yields a historical, request-level view of latency from the client through the ALB to the target without adding any agents or scripts to the EC2 instances. It also lets you filter for slow requests, group by URL or target, and determine whether delay occurs in the ALB-to-target hop or in the target application itself.

Why this answer

Enabling detailed CloudWatch metrics on the ALB and analyzing ALB access logs provides visibility into request latency patterns without affecting live traffic. Option A is wrong because setting up a separate test environment does not directly help diagnose the current intermittent issue. Option B is wrong because SSHing into instances and running commands can impact production performance and does not provide historical latency data.

Option D is wrong because tcpdump generates large packet captures that can degrade performance and requires significant analysis effort.

755
Multi-Selectmedium

A company is using Amazon CloudWatch Logs to store application logs. The security team requires that logs are encrypted at rest using a customer-managed AWS KMS key. Which TWO steps are necessary to achieve this?

Select 2 answers
A.Use the CloudWatch Logs console or API to associate the KMS key with the log group
B.Enable default encryption for CloudWatch Logs in the AWS account settings
C.Update the log group's resource policy to reference the KMS key
D.Associate the KMS key with each log stream individually
E.Create a customer-managed KMS key with appropriate key policy that allows CloudWatch Logs to use the key
AnswersA, E

The correct action is to explicitly associate your customer-managed AWS KMS key with the CloudWatch Logs log group, either through the console or by calling the `AssociateKmsKey` API. This association defines the encryption boundary at the log group level and applies to all existing and future log streams within that group. The key-policy prerequisites must already be in place, but the actual enabling step is this association.

Why this answer

Option E is correct because CloudWatch Logs encryption at rest with a customer-managed key requires first creating a customer-managed KMS key in KMS and attaching a key policy that grants the CloudWatch Logs service principal (logs.<region>.amazonaws.com) the necessary kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey*, and kms:Describe* permissions. Option A is correct because, once the key exists, you must explicitly associate it with the specific log group using the CloudWatch Logs console, the AWS CLI (aws logs associate-kms-key --log-group-name <name> --kms-key-id <key-arn>), or the AssociateKmsKey API; encryption is applied at the log group level. Option B is not correct because CloudWatch Logs has no account-level 'default encryption' toggle; encryption must be set per log group.

Option C is not correct because a log group resource policy controls access to log data, not KMS encryption, and does not enable encryption at rest. Option D is not correct because KMS keys are associated with log groups, not individual log streams, so per-stream association is neither possible nor required.

Exam trap

DOP-C02 often tests the misconception that a log group resource policy or an account-wide setting can enable KMS encryption, when in fact you need both a properly permissioned customer-managed key AND a per-log-group association.

756
MCQeasy

A company wants to monitor the number of messages that are published to an Amazon SNS topic. Which CloudWatch metric should be used?

A.SMSMonthToDateSpentUSD
B.PublishSize
C.NumberOfNotificationsDelivered
D.NumberOfMessagesPublished
AnswerD

NumberOfMessagesPublished is the correct Amazon SNS CloudWatch metric for monitoring message volume. It increments for every successful publish operation to an SNS topic, including individual messages sent via the Publish API and each message within a PublishBatch request. This metric provides the exact count of messages accepted by the topic, making it the appropriate choice for tracking publication activity.

Why this answer

The CloudWatch metric 'NumberOfMessagesPublished' tracks the number of messages published to an SNS topic. Option A (SMSMonthToDateSpentUSD) tracks monthly SMS spend, not messages published. Option B (PublishSize) is not a standard SNS metric; the relevant metric is 'PublishSize' for message size, but it's not for counting messages.

Option C (NumberOfNotificationsDelivered) counts messages delivered to subscribers, not published.

757
MCQhard

A DevOps engineer is designing a CI/CD pipeline using AWS CodePipeline. The source stage is AWS CodeCommit, and the build stage uses AWS CodeBuild. The pipeline must only trigger on changes to the main branch. However, the engineer notices that the pipeline is also triggering on changes to feature branches that are merged via pull requests. What configuration change should the engineer make to ensure the pipeline only triggers on direct commits to the main branch?

A.Configure the CodeCommit repository to disable events for all branches except main.
B.Add a branch filter in the CloudWatch Events rule that triggers the pipeline, specifying only the main branch.
C.Modify the pipeline's source stage to use a branch name filter, which will ignore events from other branches.
D.Use a Lambda function as a source action to check the branch before starting the build.
AnswerB

By adding a branchName filter to the event pattern of the CloudWatch Events (EventBridge) rule that invokes the pipeline, the rule only triggers when a push occurs on the main branch. This is the documented and precise way to restrict executions by branch while still capturing all relevant repository state changes. The filter is evaluated in the event pattern, so other branches don't initiate a pipeline run.

Why this answer

AWS CodePipeline pipelines are triggered by CloudWatch Events rules that monitor CodeCommit repository events. By default, the rule may trigger on all branch changes. Adding a branch filter in the CloudWatch Events rule that specifies only the main branch ensures that only direct commits to main trigger the pipeline, ignoring feature branch merges.

Exam trap

The trap here is that candidates often confuse the pipeline source stage branch filter (which only affects which branch is used as source code) with the CloudWatch Events rule branch filter (which controls which events actually trigger the pipeline), leading them to incorrectly select option C.

Why the other options are wrong

A

CodeCommit does not have a per-branch event setting; events are emitted for all branches.

C

The branch name in the source action only defines which branch to pull; the trigger event still comes from any branch unless filtered at the event rule.

D

This is a workaround but not the standard or efficient solution; the event rule filter is simpler.

758
MCQhard

An organization uses AWS System Manager Patch Manager to patch EC2 instances. The patches are not being applied to some instances. The instances are running Amazon Linux 2 and have the SSM Agent installed. What is the MOST likely reason for the failure?

A.The instances do not have internet access to reach the Systems Manager endpoint.
B.The SSM Agent is out of date and needs to be updated.
C.The instances are missing the required IAM role for Systems Manager.
D.The instances are not running a supported operating system.
AnswerC

To allow the SSM Agent to call Systems Manager APIs, an instance must have an IAM instance profile with the AmazonSSMManagedInstanceCore managed policy. Without this role, the agent cannot authenticate, and the instance will not appear as a managed node in Patch Manager, so no patching can occur.

Why this answer

Instances must have an IAM role that grants Systems Manager permissions to manage patches. Without this role, the SSM Agent cannot communicate with the Systems Manager service, preventing patch application. Option A is incorrect because instances can use VPC endpoints (e.g., AWS PrivateLink) to reach Systems Manager without internet access.

Option B is incorrect: although an out-of-date SSM Agent can cause issues, the agent auto-updates by default, and the most common cause for patch failures is missing IAM permissions, not an outdated agent. Option D is incorrect because Amazon Linux 2 is a fully supported operating system for Patch Manager.

759
MCQeasy

A DevOps engineer needs to monitor the memory utilization of an Amazon EC2 instance running a critical application. Which AWS service should be used to collect and track this metric?

A.AWS CloudTrail
B.AWS X-Ray
C.AWS Config
D.Amazon CloudWatch
AnswerD

Amazon CloudWatch is the native monitoring service for AWS, collecting metrics, logs, and events from AWS resources and applications. The CloudWatch Agent, installed on EC2 instances or on-premises servers, can collect memory utilization metrics (such as mem_used_percent) and publish them as custom metrics to CloudWatch, enabling alarms and dashboards. Without the agent, standard EC2 metrics include CPU, disk, and network but not memory, so using CloudWatch with the agent is the appropriate solution.

Why this answer

Amazon CloudWatch is the correct service for monitoring memory utilization of EC2 instances. CloudWatch can collect custom metrics like memory utilization via the CloudWatch Agent. AWS CloudTrail (A) records API calls, not memory metrics.

AWS X-Ray (B) traces application requests, not system metrics. AWS Config (C) records resource configuration changes, not utilization metrics.

760
Drag & Dropmedium

Drag and drop the steps to configure an AWS Elastic Load Balancer (ALB) with HTTPS listeners and target groups.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

First create the target group, then create the ALB, then configure HTTPS listener, then register targets, then add redirect rule.

761
MCQmedium

A DevOps engineer is designing a CI/CD pipeline using AWS CodePipeline. The pipeline deploys a critical application. Which security practice should the engineer implement to prevent unauthorized changes to the pipeline?

A.Encrypt the pipeline artifacts using AWS KMS
B.Use SNS to send notifications when the pipeline is updated
C.Attach an IAM policy that uses a condition to allow only specific users or roles to modify the pipeline
D.Enable AWS CloudTrail and create a CloudWatch Events rule to notify on pipeline changes
AnswerC

Attaching an IAM policy that uses a condition such as aws:PrincipalArn to the CodePipeline administrative actions (for example, UpdatePipeline and CreatePipeline) is the correct preventive control. This restricts the set of principals who can modify the pipeline definition no matter how the request is made, and it can be combined with resource-level permissions and least-privilege scoping. It directly addresses unauthorized pipeline modifications at the authorization layer.

Why this answer

The most direct preventive control is an IAM policy with a condition that restricts who can call CodePipeline mutation APIs (UpdatePipeline, DeletePipeline, PutApprovalResult, etc.). By scoping permissions to specific users or roles via IAM conditions (e.g., aws:PrincipalArn, aws:SourceVpce), the engineer enforces least privilege and blocks unauthorized modifications at the API layer.

Exam trap

DOP-C02 often tests the difference between preventive controls (IAM policies, SCPs) and detective controls (CloudTrail, SNS, CloudWatch) — candidates frequently pick logging/notification answers when the question asks how to prevent unauthorized changes.

How to eliminate wrong answers

Option A is wrong because KMS encryption protects artifacts at rest but does nothing to prevent an authorized principal from modifying the pipeline definition — encryption is a confidentiality control, not an authorization control. Option B is wrong because SNS notifications are detective, not preventive — they alert after a change has already occurred. Option D is wrong because CloudTrail plus CloudWatch Events is also detective; it logs and notifies about pipeline changes but does not block them.

Only IAM policy conditions provide the preventive authorization control the question asks for.

762
MCQeasy

A company uses AWS CloudFormation to deploy infrastructure. A recent stack update failed, and the engineer needs to roll back to the previous stable state. Which CloudFormation feature should the engineer use?

A.Use AWS CloudFormation Drift Detection.
B.Use AWS CloudFormation StackSets.
C.Use the 'Rollback' action in the CloudFormation console.
D.Create a Change Set and execute it.
AnswerC

The 'Rollback' action in the CloudFormation console is the correct approach because CloudFormation maintains an automatic rollback trigger for failed update operations, and when an update enters a failed state, you can explicitly invoke 'Rollback' from the console to restore the stack to its last known good template and parameter state. This action is specifically designed to undo the partial or failed changes, reverting affected AWS resources to their pre-update configuration, and is the direct rollback mechanism within CloudFormation's lifecycle.

Why this answer

CloudFormation provides a built-in 'Rollback' action that automatically reverts a stack to its last known stable state when a stack update fails. This rollback occurs by default on failure, but if the engineer needs to manually trigger it after a failed update, they can use the 'Rollback' action in the CloudFormation console or API (e.g., `aws cloudformation rollback-stack`). This ensures the infrastructure returns to the previous working configuration without manual intervention.

Exam trap

The trap here is that candidates may confuse the 'Rollback' action with creating a Change Set or using Drift Detection, thinking they need to manually define the previous state, when in fact CloudFormation automatically preserves the previous stable state for rollback.

How to eliminate wrong answers

Option A is wrong because Drift Detection is used to identify whether a stack's actual resources have deviated from the expected template configuration, not to roll back a failed update. Option B is wrong because StackSets are designed to deploy stacks across multiple accounts and regions, not to handle rollback of a single stack update. Option D is wrong because creating and executing a Change Set is a method to propose and apply changes to a stack, but it does not automatically revert to the previous state; it would require the engineer to manually define the previous template and parameters, which is less efficient than using the built-in rollback feature.

763
Multi-Selectmedium

An IAM policy is attached to a service role used by AWS CodePipeline. Which TWO statements about this policy are correct?

Select 2 answers
A.The policy allows updating the pipeline definition
B.The policy allows starting any CodeBuild project
C.The policy allows starting a pipeline execution
D.The policy allows reporting job success or failure to CodePipeline
E.The policy allows reading and writing objects to any S3 bucket
AnswersC, D

The policy grants 'codepipeline:StartPipelineExecution' with a Resource element of '*', so the service role can trigger a new execution for any pipeline in the AWS account, not just a single named pipeline. In IAM, an action with Resource '*' matches all ARNs for that service; thus, the permission is not scoped to a specific pipeline. This statement is correct because the action is explicitly allowed and the resource constraint is unlimited.

Why this answer

The IAM policy attached to a CodePipeline service role must include permissions to allow the pipeline to start executions. The `codepipeline:StartPipelineExecution` action is required for the pipeline to be triggered by events or manual starts. Without this permission, the pipeline cannot initiate its execution flow.

Exam trap

The trap here is that candidates often confuse the permissions needed for the service role (runtime actions like starting executions and reporting status) with permissions for managing the pipeline (like updating the pipeline definition), leading them to select administrative actions instead of execution-specific ones.

764
MCQeasy

A team wants to automatically deploy a new version of a Lambda function when code is pushed to a CodeCommit repository. Which AWS service should orchestrate this workflow?

A.AWS CodeDeploy
B.AWS CodeBuild
C.AWS CodePipeline
D.AWS CloudFormation
AnswerC

AWS CodePipeline is the correct choice because it is a fully managed continuous delivery service that orchestrates the entire release process, from source code changes to production deployment. It can automatically detect new commits in a repository (e.g., GitHub, CodeCommit, S3) and then trigger a series of sequential or parallel stages, such as build with CodeBuild, test, and deploy via CodeDeploy or a direct Lambda update. By modeling the Lambda deployment as a pipeline action, CodePipeline ensures that each new version is built, tested, and deployed automatically and consistently, with the ability to add manual approvals or rollback steps.

Why this answer

AWS CodePipeline is the correct service because it is a fully managed continuous delivery service that orchestrates the entire release process, including source code changes from CodeCommit, building with CodeBuild, and deploying to Lambda. It can automatically trigger a pipeline execution when a new commit is pushed to a CodeCommit repository, enabling automated deployment of the Lambda function.

Exam trap

The trap here is that candidates often confuse CodeDeploy as the orchestrator because it handles the deployment step, but CodePipeline is the service that orchestrates the entire end-to-end workflow from source to deployment.

How to eliminate wrong answers

Option A is wrong because AWS CodeDeploy is a deployment service that automates application deployments to compute services like EC2, Lambda, or on-premises instances, but it does not orchestrate the entire workflow or detect source code changes in CodeCommit. Option B is wrong because AWS CodeBuild is a fully managed build service that compiles source code, runs tests, and produces artifacts, but it cannot orchestrate the multi-stage workflow or trigger deployments on its own. Option D is wrong because AWS CloudFormation is an infrastructure-as-code service for provisioning and managing AWS resources, but it is not designed to orchestrate continuous delivery pipelines triggered by code repository events.

765
MCQeasy

A company wants to automatically recover an Amazon RDS DB instance if the underlying hardware fails. Which feature should the DevOps engineer enable?

A.Multi-AZ deployment.
B.Deletion protection.
C.Read replicas in a different Region.
D.Automated backups with a retention period of 35 days.
AnswerA

Multi-AZ maintains a synchronous standby in a different Availability Zone and automatically fails over to it when the primary's hardware fails, satisfying the stem's automatic recovery requirement. A single-AZ instance would remain unavailable until AWS or manual intervention restored it.

Why this answer

Multi-AZ deployment maintains a synchronous standby replica in a different Availability Zone and automatically fails over to it if the primary instance's hardware fails, the AZ becomes unavailable, or the instance is rebooted with failover. This is the only RDS feature designed for automatic hardware-failure recovery with minimal downtime (typically 60–120 seconds). Deletion protection, cross-Region read replicas, and automated backups do not provide automatic failover on hardware failure.

Exam trap

DOP-C02 often tests the distinction between high availability (Multi-AZ, automatic failover) and disaster recovery (cross-Region read replicas, backups), so candidates who see 'different Region' or 'backups' and assume automatic recovery pick the wrong option.

How to eliminate wrong answers

Option B is wrong because deletion protection only prevents accidental deletion of the DB instance via the console, CLI, or API — it has no role in detecting or recovering from hardware failure. Option C is wrong because cross-Region read replicas are asynchronous copies used for disaster recovery or read scaling; they do not automatically promote on primary hardware failure and require manual intervention (or custom automation) to fail over. Option D is wrong because automated backups with a 35-day retention period only enable point-in-time restore to a new instance after a failure — recovery is manual, takes time, and does not provide automatic failover.

766
Multi-Selecteasy

Which TWO AWS services can be used to centrally manage and enforce security policies across multiple accounts? (Choose 2.)

Select 2 answers
A.Amazon S3
B.Amazon CloudWatch
C.AWS Organizations
D.AWS Control Tower
E.AWS Lambda
AnswersC, D

AWS Organizations provides central management of multiple AWS accounts through hierarchical grouping into organizational units (OUs). It enables the creation and enforcement of service control policies (SCPs), which act as guardrails to restrict the maximum permissions of IAM roles and users across member accounts. SCPs can be attached to the root, OUs, or individual accounts, giving centralized, policy-based control over an entire enterprise environment.

Why this answer

AWS Organizations allows you to centrally manage and enforce security policies across multiple accounts by using Service Control Policies (SCPs). SCPs define the maximum permissions for accounts in an organization, enabling you to restrict access to services or actions without requiring per-account configuration. AWS Control Tower provides a managed service that automates the setup of a multi-account environment with pre-built guardrails, which are implemented using SCPs and AWS Config rules to enforce security and compliance policies consistently.

Exam trap

The trap here is that candidates often confuse AWS Organizations with AWS Control Tower, thinking they are mutually exclusive, but Control Tower actually builds on Organizations to provide a higher-level managed governance solution, making both correct for central policy enforcement.

767
Multi-Selecthard

A company needs to enforce that all IAM users must use multi-factor authentication (MFA) to perform any AWS Console actions. Which TWO steps should be taken to enforce this?

Select 2 answers
A.Attach the policy to all IAM users or a group containing all users
B.Create an SCP in AWS Organizations
C.Create an IAM policy that uses the aws:MultiFactorAuthPresent condition key to deny access if false
D.Set an account alias for the root user
E.Enable CloudTrail to log MFA usage
AnswersA, C

Attaching the policy to every IAM user—or more efficiently, to a group that contains all users—is the only way to make the MFA enforcement policy effective because IAM policies have no effect until they are attached to a principal. Group-based attachment centralizes administration; when a new user is added to the group, the same MFA requirement is automatically inherited. This is the correct deployment step for the policy described in the answer.

Why this answer

Option C is correct because an IAM policy that uses the aws:MultiFactorAuthPresent condition key with a Deny effect when the value is false is the standard mechanism to block console (and API) actions for users who have not authenticated with MFA. Option A is correct because such a policy only takes effect once it is attached to the relevant principals — attaching it to all IAM users or to a group that contains all users ensures every user is covered. Option B is not appropriate here because SCPs apply at the AWS Organizations OU/account level and cannot enforce per-IAM-user MFA for console sign-in within a single account.

Option D is irrelevant since an account alias only changes the sign-in URL and has no bearing on MFA enforcement. Option E is incorrect because CloudTrail only records API activity for auditing; it does not enforce MFA.

Exam trap

DOP-C02 often tests the pairing requirement — candidates pick the condition-key policy but forget it must be attached to users/groups, or they pick SCPs thinking account-level controls enforce user MFA.

768
MCQmedium

A company has an AWS Lambda function that processes S3 events. The function is invoked multiple times for the same S3 object, causing duplicate processing. The engineer suspects the issue is related to retries from the S3 event notification or Lambda's built-in retry behavior. What is the MOST effective way to ensure idempotent processing?

A.Modify the S3 bucket event notification configuration to use a prefix filter that excludes duplicate objects.
B.Use a DynamoDB table to store a record of processed S3 object keys and check for existence before processing.
C.Set the Lambda function's ReservedConcurrency to 1 to prevent concurrent executions.
D.Use an Amazon SQS FIFO queue as the event source and enable content-based deduplication.
AnswerB

Recording processed S3 object keys in a DynamoDB table and checking for existence before processing makes the Lambda function idempotent. Use a conditional write, such as PutItem with ConditionExpression: attribute_not_exists(partition_key), so the first invocation for a given object key proceeds and subsequent duplicates fail the condition and exit without side effects. This is the recommended pattern because it works regardless of how many duplicate events S3 delivers and does not depend on delivery semantics.

Why this answer

Storing processed S3 object keys in a DynamoDB table and checking for existence before processing ensures idempotency at the application level. This approach directly handles duplicate invocations caused by S3 event retries or Lambda's built-in retry behavior, as the function can conditionally skip processing if the key already exists in DynamoDB. It provides a durable, consistent, and scalable mechanism to prevent duplicate processing regardless of how many times the function is invoked for the same object.

Exam trap

The trap here is that candidates often confuse concurrency control (ReservedConcurrency) with idempotency, or assume SQS FIFO deduplication is a drop-in solution without realizing S3 cannot directly send events to FIFO queues.

How to eliminate wrong answers

Option A is wrong because S3 prefix filters only filter events based on object key prefixes or suffixes, not on duplicate detection; they cannot prevent multiple notifications for the same object. Option C is wrong because setting ReservedConcurrency to 1 prevents concurrent executions but does not prevent sequential duplicate invocations from retries; the function could still be invoked multiple times for the same object in sequence. Option D is wrong because using an SQS FIFO queue with content-based deduplication would require the S3 event notification to be sent to the queue, but S3 does not natively support sending events to SQS FIFO queues; it only supports standard SQS queues, and even if it did, the deduplication window is only 5 minutes, which may not cover all retry scenarios.

769
MCQeasy

A DevOps engineer is designing a highly available web application using Amazon Route 53. The application is deployed in two AWS Regions. The engineer wants to route traffic to the nearest healthy endpoint. Which routing policy should be used?

A.Failover routing
B.Weighted routing
C.Geolocation routing
D.Latency routing
AnswerD

Latency routing directs users to the Region with the lowest measured latency, satisfying the nearest-healthy-endpoint requirement. Route 53 latency records support health checks, so unhealthy endpoints are excluded automatically. Unlike geolocation, which maps users by geography, latency uses actual network performance between resolver and endpoint.

Why this answer

Latency routing in Amazon Route 53 directs users to the AWS Region that provides the lowest network latency, which matches the requirement to route traffic to the nearest healthy endpoint. Route 53 uses latency measurements between the user and each AWS Region to select the optimal record. Health checks can be associated with latency records to ensure traffic only goes to healthy endpoints.

Exam trap

DOP-C02 often tests the distinction between latency and geolocation routing; candidates may incorrectly choose geolocation because they equate 'nearest' with geographic proximity, but latency routing is specifically for lowest network latency.

How to eliminate wrong answers

Option A is wrong because failover routing is designed for active-passive configurations, not for selecting the lowest-latency endpoint among multiple active regions. Option B is wrong because weighted routing distributes traffic based on assigned weights, not on network latency or proximity. Option C is wrong because geolocation routing directs traffic based on the geographic location of the user (e.g., country or continent), which does not guarantee the lowest latency and may not align with 'nearest healthy endpoint' if latency differs from geographic distance.

770
Multi-Selecthard

A company uses Amazon CloudWatch Logs to centralize logs from multiple EC2 instances running a web application. The DevOps team needs to create a metric filter that parses logs for HTTP status codes (e.g., 4xx and 5xx) and increment a metric. Additionally, they need to create a CloudWatch alarm on the error count. Which of the following are required to achieve this? (Select TWO.)

Select 2 answers
A.Create an IAM role that allows CloudWatch Logs to read the log data and publish metrics.
B.Define the metric filter pattern to match HTTP status codes in the log entries.
C.Create a metric filter in CloudWatch Logs on the log group that contains the application logs.
D.Configure a subscription filter to forward the logs to a Lambda function that creates the metric.
E.Install the CloudWatch Agent on the EC2 instances to send the logs.
AnswersB, C

The metric filter pattern is the core of the extraction process: it defines exactly which log events should be matched and how the metric value is derived, such as counting occurrences of a 4xx or 5xx status code. For example, a pattern like "[*, _, _, status_code]" or a JSON pattern like "{ $.status_code = 4* }" is needed to parse the relevant field correctly from the log entry. If the pattern is not defined, CloudWatch Logs has no way to know which log lines correspond to an HTTP status code or what value to emit for the CloudWatch metric.

Why this answer

The correct answers are B and C. A metric filter must be defined on a log group (option C) to extract metrics, and the filter pattern must match the HTTP status codes in the log entries (option B). Option A is not required because CloudWatch Logs can publish metrics without an additional IAM role; the log group already has sufficient permissions.

Option D is incorrect because subscription filters are for streaming logs to other destinations, not for creating metrics. Option E is not required because the CloudWatch Logs agent or the unified CloudWatch agent can send logs, but the question does not specify which agent; the default agent suffices.

771
MCQhard

A company has a production Amazon EKS cluster with multiple node groups. The DevOps team notices that some pods are frequently restarting due to OOMKilled errors, but the cluster-level metrics (CPU, memory) appear normal. Which CloudWatch Container Insights metric should be analyzed to identify the specific node or pod causing the issue?

A.node_memory_utilization.
B.number_of_running_pods.
C.pod_memory_utilization.
D.pod_cpu_utilization.
AnswerC

Pod memory utilization directly shows memory usage per pod compared to its configured limit, which is the exact condition that triggers the kernel's out-of-memory killer. When a container's working set (container_memory_working_set_bytes) exceeds its memory limit, the OOM killer terminates it with exit code 137, so plotting this metric against the limit surfaces the specific pod(s) at fault and helps correlate with OOMKilled events in kubectl get pods.

Why this answer

OOMKilled errors are caused by individual containers exceeding their memory limits, which is a pod-level (container-level) condition. CloudWatch Container Insights exposes 'pod_memory_utilization' (and 'container_memory_utilization') per pod, allowing you to pinpoint which pod is hitting its memory limit even when node-level memory looks normal. This is the metric that directly correlates with OOMKilled restarts.

Exam trap

DOP-C02 often tests the node-vs-pod metric distinction by making cluster-level metrics look normal, so candidates who pick node_memory_utilization miss that OOMKilled is a per-container cgroup limit event, not a node exhaustion event.

How to eliminate wrong answers

Option A is wrong because node_memory_utilization shows aggregate memory usage per node — if the node has spare memory, this metric looks normal even though a specific pod is being OOMKilled due to its own limit. Option B is wrong because number_of_running_pods is a count metric that tells you how many pods are running, not how much memory any pod is consuming, so it cannot identify the offending pod. Option D is wrong because pod_cpu_utilization measures CPU, not memory — OOMKilled is a memory-limit event, so CPU metrics are irrelevant to diagnosing it.

772
MCQhard

A DevOps engineer applies this S3 bucket policy to an S3 bucket. What is the effect of this policy?

A.All objects uploaded must be encrypted with SSE-C.
B.All uploads to the bucket are blocked.
C.All objects uploaded must use server-side encryption with Amazon S3 managed keys (SSE-S3).
D.All objects uploaded must be encrypted with SSE-KMS.
AnswerC

The policy grants s3:PutObject only when the s3:x-amz-server-side-encryption request header is exactly AES256. In S3, that header value maps to SSE-S3, where Amazon S3 manages the encryption keys using AES-256. Consequently, any object uploaded must be encrypted with SSE-S3, and uploads using no encryption or any other encryption method are denied.

Why this answer

The S3 bucket policy in question denies uploads unless the `x-amz-server-side-encryption` header is set to `AES256`, which is the value for SSE-S3 (Amazon S3 managed keys). This ensures that all objects uploaded to the bucket must be encrypted using server-side encryption with S3-managed keys (SSE-S3). Option C correctly identifies this requirement.

Exam trap

The trap here is that candidates confuse the `x-amz-server-side-encryption` header values: `AES256` is specific to SSE-S3, not SSE-C or SSE-KMS, leading to incorrect selections of A or D.

How to eliminate wrong answers

Option A is wrong because SSE-C requires the `x-amz-server-side-encryption-customer-algorithm` header, not `x-amz-server-side-encryption: AES256`. Option B is wrong because the policy does not block all uploads; it only denies uploads that do not meet the encryption requirement, so uploads with the correct encryption header are allowed. Option D is wrong because SSE-KMS requires the `x-amz-server-side-encryption` header set to `aws:kms`, not `AES256`.

773
MCQeasy

A DevOps engineer needs to centralize logs from multiple AWS accounts into a single CloudWatch Logs account. Which feature should be used?

A.CloudWatch Logs Insights
B.AWS CloudTrail
C.Amazon Kinesis Data Firehose
D.CloudWatch Logs cross-account subscription
AnswerD

CloudWatch Logs cross-account subscription allows a central (destination) account to create a destination policy and use subscription filters in source accounts to forward log events in real time to a central log group or a Kinesis Data Streams/Firehose pipeline. This feature natively supports aggregating logs from multiple AWS accounts into a single location, providing centralized monitoring and analysis. It directly meets the requirement to centralize logs from multiple AWS accounts, making it the correct choice.

Why this answer

CloudWatch Logs cross-account subscription (Option D) allows you to stream log data from multiple source AWS accounts to a single destination account's CloudWatch Logs log group. This is the native, managed feature designed specifically for centralizing logs across accounts without needing additional infrastructure or data transformation.

Exam trap

The trap here is that candidates often confuse CloudWatch Logs Insights (a query tool) with the actual cross-account log forwarding mechanism, or they incorrectly assume that CloudTrail or Kinesis Data Firehose are the primary services for cross-account log centralization, when in fact the native CloudWatch Logs cross-account subscription is the correct, managed solution.

How to eliminate wrong answers

Option A is wrong because CloudWatch Logs Insights is a query and analysis tool for searching and visualizing log data within a single account; it does not provide cross-account log ingestion or forwarding. Option B is wrong because AWS CloudTrail records API activity and can deliver logs to CloudWatch Logs, but it is not a mechanism for centralizing logs from multiple accounts into a single CloudWatch Logs destination. Option C is wrong because Amazon Kinesis Data Firehose is a streaming data delivery service that can load logs into destinations like S3 or Redshift, but it is not designed for direct cross-account CloudWatch Logs subscription; it would require additional setup and does not natively support the cross-account subscription model.

774
MCQhard

A company deploys a serverless application using AWS SAM. The application includes an API Gateway REST API and multiple Lambda functions. The team wants to implement canary deployments for the API to gradually shift traffic to a new version. Which SAM template configuration should be used?

A.Use the CanaryDeployment property on the Serverless::Function resource with a DeploymentPreference
B.Create multiple Lambda function versions and use API Gateway stage variables to switch between them
C.Define the Lambda function with AutoPublishAlias: live and set the API Gateway integration to point to the alias
D.Use AWS CloudFormation's UpdatePolicy with AutoScalingRollingUpdate
AnswerA

The SAM CanaryDeployment property, when paired with a DeploymentPreference such as 'Canary10Percent5Minutes', delegates to AWS CodeDeploy to manage a gradual traffic shift. CodeDeploy publishes a new Lambda version, then adjusts the alias's routing configuration to send only 10% of live invocations to the new version for a 5-minute observation period, and finally shifts the remaining 90% after the interval succeeds. It also supports CloudWatch alarm-based automatic rollback, making it the only option here that provides a managed, gradual, and rollback-capable canary release on Lambda.

Why this answer

AWS SAM's `CanaryDeployment` property on the `AWS::Serverless::Function` resource, combined with a `DeploymentPreference` of type `Canary10Percent5Minutes`, enables gradual traffic shifting for API Gateway integrations. This configuration automatically creates a Lambda alias, publishes new versions, and shifts a percentage of API traffic to the new version over a specified time window, all without manual intervention.

Exam trap

The trap here is that candidates often confuse `AutoPublishAlias` with canary deployments, assuming that publishing a new version and pointing an alias to it automatically shifts traffic gradually, when in fact it requires an explicit `DeploymentPreference` with a canary type to enable traffic shifting.

How to eliminate wrong answers

Option B is wrong because manually creating multiple Lambda function versions and using API Gateway stage variables to switch between them is a manual, error-prone approach that does not provide automated canary traffic shifting or rollback capabilities. Option C is wrong because while `AutoPublishAlias: live` creates a Lambda alias and publishes new versions, it does not by itself implement canary deployments; it only points the API Gateway integration to a single alias, requiring additional custom logic for traffic shifting. Option D is wrong because `AWS CloudFormation's UpdatePolicy with AutoScalingRollingUpdate` is designed for Auto Scaling groups or EC2-based rolling updates, not for serverless resources like Lambda functions or API Gateway, and it does not support canary traffic shifting for API endpoints.

775
MCQeasy

A DevOps engineer needs to monitor the number of messages in an Amazon SQS queue and trigger an Auto Scaling policy to add more EC2 instances when the queue depth exceeds a threshold. Which CloudWatch metric should the alarm use?

A.NumberOfMessagesSent
B.ApproximateNumberOfMessagesNotVisible
C.ApproximateNumberOfMessagesVisible
D.SentMessageSize
AnswerC

ApproximateNumberOfMessagesVisible is the correct CloudWatch metric for monitoring queue depth because it reports the number of messages available in the SQS queue for immediate retrieval by consumers. This value directly reflects the backlog of work waiting to be processed, making it the standard metric used for autoscaling consumers or triggering alarms. It is approximate due to SQS's distributed architecture, but it is polled frequently enough to provide a reliable real-time indicator of queue pressure.

Why this answer

(ApproximateNumberOfMessagesVisible) is the correct metric because it represents the number of messages available to be retrieved from the queue. When this number exceeds a threshold, it indicates that consumer EC2 instances are not keeping up, so an Auto Scaling policy can add more instances to handle the load. Option A (NumberOfMessagesSent) is a count of messages sent, not the current queue depth.

Option B (ApproximateNumberOfMessagesNotVisible) represents messages that are in flight (being processed) and not available for retrieval. Option D (SentMessageSize) is the size of messages sent, not the count. Therefore, C is correct.

776
Multi-Selecteasy

Which TWO AWS services can be used as source actions in AWS CodePipeline to automatically trigger a pipeline when changes are made? (Choose two.)

Select 2 answers
A.Amazon CloudWatch
B.Amazon S3
C.Amazon EC2
D.AWS CloudFormation
E.AWS CodeCommit
AnswersB, E

Amazon S3 is a supported CodePipeline Source action that detects new uploads when versioning is enabled, either through CloudWatch Events or periodic polling. When a new object version is written to the designated bucket and key, CodePipeline starts a pipeline execution and downloads that object as the input artifact for downstream stages. This makes S3 a common choice for external tooling or third-party providers to drop build artifacts.

Why this answer

Amazon S3 is a valid source action in AWS CodePipeline because you can configure a pipeline to start when a new object is created or an existing object is updated in an S3 bucket. This is achieved by enabling Amazon S3 event notifications (via Amazon S3 Event Notifications) that send events to Amazon CloudWatch Events or directly to AWS CodePipeline using a CloudWatch Events rule, which then triggers the pipeline execution. This allows automatic pipeline runs on code or artifact changes stored in S3.

Exam trap

The trap here is that candidates often confuse Amazon CloudWatch (a monitoring service) with Amazon EventBridge (the event bus service that actually triggers pipelines), or they think EC2 can be a source because it can run scripts that poll for changes, but CodePipeline source actions require native event-driven integration, not custom polling.

777
MCQmedium

A company has deployed a multi-tier application on AWS. The web tier uses an Auto Scaling group of EC2 instances behind an Application Load Balancer. The application tier uses another Auto Scaling group of EC2 instances that process messages from an Amazon SQS queue. The database tier uses Amazon RDS Multi-AZ. Recently, the application experienced a complete outage when the SQS queue became overwhelmed with messages due to a sudden spike in traffic. The application tier could not process messages fast enough, causing the queue to grow indefinitely and eventually exceed the visibility timeout, leading to message loss and degraded performance. The DevOps engineer needs to improve the resilience of the architecture to handle traffic spikes without losing messages. Which solution should be implemented?

A.Limit the maximum message size and set a queue size limit to prevent overflow
B.Replace the standard SQS queue with a FIFO SQS queue to ensure exactly-once processing
C.Increase the visibility timeout in the SQS queue to allow more time for processing
D.Configure a dead-letter queue for unprocessed messages and implement Auto Scaling based on SQS queue depth
AnswerD

A dead-letter queue (DLQ) captures messages that remain unprocessed after multiple attempts, preserving them for later analysis or manual intervention, while Auto Scaling based on SQS queue depth dynamically adjusts the number of consumers to match incoming load. This combination ensures that spikes in traffic are handled by adding more processing capacity, and messages that cannot be processed are not permanently lost, providing both reliability and scalability.

Why this answer

It addresses both the message loss and processing bottleneck. A dead-letter queue (DLQ) captures messages that cannot be processed successfully after a specified number of attempts, preventing them from being lost when the visibility timeout expires. Implementing Auto Scaling based on SQS queue depth (using a CloudWatch alarm on the ApproximateNumberOfMessagesVisible metric) dynamically adds more application-tier EC2 instances when the queue grows, ensuring the processing rate scales with demand and prevents the queue from being overwhelmed.

Exam trap

The trap here is that candidates often focus on increasing visibility timeout or switching queue types to fix message loss, but they miss the core issue: the application tier lacks elasticity to scale with queue depth, and a DLQ is needed to safely capture messages that exceed processing attempts.

How to eliminate wrong answers

Option A is wrong because limiting maximum message size and setting a queue size limit does not prevent message loss; SQS does not have a configurable queue size limit (it can hold an unlimited number of messages), and reducing message size does not address the processing speed bottleneck. Option B is wrong because replacing a standard queue with a FIFO queue does not improve resilience to traffic spikes; FIFO queues have lower throughput (3000 messages per second with batching) and are designed for exactly-once ordering, not for handling high-volume bursts, and they do not prevent message loss from visibility timeout expiration. Option C is wrong because increasing the visibility timeout only delays when unprocessed messages become visible again; it does not prevent the queue from growing indefinitely or stop message loss if the application tier cannot keep up, and it can actually worsen the problem by hiding messages longer, leading to higher latency and potential starvation.

778
Multi-Selectmedium

A company is designing a CI/CD pipeline for a microservices architecture using AWS CodePipeline. They want to use infrastructure as code to manage the pipeline itself. Which TWO services can be used together to achieve this?

Select 2 answers
A.AWS Service Catalog
B.AWS CodePipeline
C.AWS CloudFormation
D.AWS CodeDeploy
E.AWS Elastic Beanstalk
AnswersB, C

CodePipeline is the orchestration service whose own pipeline definition can be declared as code, letting the team version and recreate the pipeline itself. It satisfies the requirement by acting as the managed resource that CloudFormation templates provision and update.

Why this answer

AWS CloudFormation [CORRECT] is the infrastructure-as-code service that lets you define and provision AWS resources, including the CodePipeline pipeline itself, in a declarative template so the pipeline is version-controlled and reproducible. AWS CodePipeline [CORRECT] is the CI/CD orchestration service that is being managed as code; CloudFormation supports an AWS::CodePipeline::Pipeline resource type, so the two services work together to define and run the pipeline from a template. AWS Service Catalog is a catalog of approved products for governed provisioning, not a way to author the pipeline as code, so it does not belong.

AWS CodeDeploy is a deployment service used as a pipeline action provider, not the IaC mechanism for managing the pipeline. AWS Elastic Beanstalk is a PaaS application-hosting service, not a pipeline-definition or IaC tool.

Exam trap

DOP-C02 often tests whether candidates confuse CodePipeline (the CI/CD service) with the IaC tool that defines it (CloudFormation), and whether they mistakenly pick CodeDeploy or Elastic Beanstalk as pipeline-definition tools.

779
MCQhard

An application running on Amazon ECS with Fargate is experiencing increased latency. The DevOps team suspects that the task is running out of memory and swapping. Which set of CloudWatch metrics should the team examine to confirm this suspicion?

A.NetworkIn and NetworkOut
B.MemoryUtilized and MemoryReserved
C.CPUUtilization and CPUReservation
D.EphemeralStorageUtilized and EphemeralStorageReserved
AnswerB

MemoryUtilized and MemoryReserved are the correct CloudWatch ECS metrics for Fargate tasks, as they directly measure the task's memory consumption against the memory limit configured in the task definition. When MemoryUtilized consistently approaches or equals MemoryReserved, the container runtime may start swapping memory pages to disk, which degrades performance. Monitoring these two metrics together provides the earliest signal of memory pressure that leads to swapping.

Why this answer

MemoryUtilized and MemoryReserved are the CloudWatch metrics that directly track memory consumption and allocation for ECS tasks using Fargate. When a task runs out of memory, the Linux kernel’s OOM killer may terminate processes, but before that, swapping can occur if swap space is available, causing increased latency. These metrics allow the DevOps team to compare actual memory usage against the task’s memory reservation, confirming if memory pressure is the root cause of the latency.

Exam trap

The trap here is that candidates may confuse memory metrics with CPU or storage metrics, assuming any resource constraint can cause swapping, but only memory metrics directly indicate memory exhaustion and potential swapping behavior.

How to eliminate wrong answers

Option A is wrong because NetworkIn and NetworkOut measure network throughput, not memory usage or swapping, so they cannot confirm memory exhaustion. Option C is wrong because CPUUtilization and CPUReservation track CPU usage and reservation, which are unrelated to memory swapping; high CPU could cause latency but does not indicate memory pressure. Option D is wrong because EphemeralStorageUtilized and EphemeralStorageReserved measure storage usage on the Fargate ephemeral volume, not memory consumption; swapping would involve memory, not ephemeral storage.

780
MCQmedium

A DevOps engineer is using AWS CloudFormation to provision a VPC that includes public and private subnets, an Internet Gateway, and NAT Gateways. The engineer wants to ensure that the private subnets have outbound internet access through the NAT Gateways. After deploying the stack, the engineer notices that instances in the private subnets cannot reach the internet. The engineer verifies that the route tables for the private subnets have a route to the NAT Gateway. What is the most likely cause of the issue?

A.The NAT Gateway is not associated with an Elastic IP address.
B.The private subnets are missing an association with a network ACL that allows outbound traffic to the NAT Gateway.
C.The route in the private subnet's route table points to the NAT Gateway in the same Availability Zone, but the NAT Gateway is in a public subnet that lacks a route to the Internet Gateway.
D.The instances in the private subnets do not have a public IP address, so they cannot communicate with the NAT Gateway.
AnswerC

For a NAT Gateway to provide internet access, its public subnet must have a route to an Internet Gateway. If the public subnet's route table does not have a route to the Internet Gateway, the NAT Gateway cannot forward traffic to the internet. This is a common misconfiguration in CloudFormation templates.

Why this answer

A NAT Gateway must reside in a public subnet that has a route to an Internet Gateway. If the public subnet's route table lacks a route to the Internet Gateway, the NAT Gateway cannot route traffic to the internet. The engineer should verify that the public subnet's route table has a route to the Internet Gateway and that the NAT Gateway is correctly placed.

Exam trap

The trap here is assuming that as long as the private subnet route table points to the NAT Gateway, internet access works, without verifying that the NAT Gateway's own subnet has a route to the Internet Gateway.

781
MCQmedium

A company's DevOps team notices that their Amazon RDS for PostgreSQL instance's CPU utilization spikes to 90% every day at 10:00 AM, causing application latency. They want to be notified when the CPU utilization exceeds 80% for more than 5 minutes to investigate the cause. Which solution should they implement?

A.Use Amazon CloudWatch Logs Insights to query the RDS logs and trigger an SNS notification when CPU utilization is high.
B.Enable AWS Trusted Advisor to automatically create a CloudWatch alarm on the CPU utilization metric.
C.Create an Amazon CloudWatch alarm on the CPUUtilization metric with a period of 5 minutes and a threshold of 80, and set the alarm action to send a notification to an Amazon SNS topic.
D.Create an AWS CloudTrail trail to monitor CPU utilization and trigger an AWS Lambda function to send an email notification.
AnswerC

A CloudWatch alarm on CPUUtilization with a five-minute period and 80% threshold, notifying via Amazon SNS, directly matches the stated requirement to alert when utilisation exceeds 80% for more than five minutes, enabling investigation of the daily 10:00 AM spike.

Why this answer

Amazon CloudWatch natively collects the CPUUtilization metric for RDS, and an alarm with a 5-minute period and an 80% threshold directly matches the requirement to alert when CPU exceeds 80% for more than 5 minutes. Configuring the alarm action to publish to an Amazon SNS topic delivers the notification to the DevOps team, which is the standard, lowest-effort solution.

Exam trap

DOP-C02 often tests the misconception that CloudTrail or Logs Insights can monitor resource metrics, when only CloudWatch metrics and alarms are designed for threshold-based performance alerting.

How to eliminate wrong answers

Option A is wrong because CloudWatch Logs Insights queries log data, not metrics, and cannot itself trigger SNS notifications based on CPU utilization thresholds. Option B is wrong because AWS Trusted Advisor provides best-practice checks and does not automatically create CloudWatch alarms on RDS CPU metrics. Option D is wrong because AWS CloudTrail records API activity, not performance metrics like CPU utilization, so it cannot detect or alert on resource saturation.

782
MCQhard

Refer to the exhibit. A DevOps engineer created this IAM policy for a CodeDeploy service role. The deployment fails with an 'AccessDenied' error when attempting to register instances with an Auto Scaling group. What is the likely cause?

A.The policy does not allow autoscaling:CompleteLifecycleAction.
B.The role is not trusted by the EC2 service.
C.The iam:PassRole action is not scoped to the correct resource.
D.The policy is missing autoscaling:UpdateAutoScalingGroup and autoscaling:SetDesiredCapacity.
AnswerD

For a deployment to an Auto Scaling group, CodeDeploy must be able to adjust the group's desired capacity and update its configuration. autoscaling:UpdateAutoScalingGroup lets CodeDeploy modify min/max/desired values, while autoscaling:SetDesiredCapacity forces the group to scale to the exact instance count required for the deployment. Without these permissions, CodeDeploy cannot perform instance replacement or blue/green transitions, causing the deployment to fail.

Why this answer

The CodeDeploy service role must include permissions for autoscaling:UpdateAutoScalingGroup and autoscaling:SetDesiredCapacity to allow CodeDeploy to register instances with an Auto Scaling group during a deployment. Without these actions, the deployment fails with an 'AccessDenied' error when CodeDeploy attempts to attach instances to the Auto Scaling group or adjust its capacity.

Exam trap

The trap here is that candidates often assume the error is due to missing lifecycle hook permissions (Option A) or a trust relationship issue (Option B), but the actual cause is the lack of specific Auto Scaling write permissions required for instance registration.

How to eliminate wrong answers

Option A is wrong because autoscaling:CompleteLifecycleAction is used for lifecycle hooks, not for registering instances with an Auto Scaling group, and its absence would not cause the described error. Option B is wrong because the role is trusted by CodeDeploy (not EC2), and the error occurs during instance registration with Auto Scaling, not during EC2 instance launch. Option C is wrong because iam:PassRole is used to pass a role to a service, but the error is about Auto Scaling actions, not about passing roles; the policy likely already allows PassRole for the correct resource.

783
Multi-Selecthard

Which THREE AWS services can be used to centrally manage and enforce security policies across multiple accounts in AWS Organizations? (Select THREE.)

Select 3 answers
A.AWS Config Conformance Packs
B.AWS Organizations Service Control Policies (SCPs)
C.AWS Systems Manager
D.AWS CloudTrail
E.AWS Firewall Manager
AnswersA, B, E

AWS Config Conformance Packs are collections of AWS Config rules and remediation actions that can be deployed across an entire AWS Organization. They enforce compliance by evaluating resource configurations against predefined templates and automatically remediating noncompliant resources. This enables centralized governance of security and operational best practices across all accounts, making them a correct answer for centrally managing compliance.

Why this answer

AWS Config Conformance Packs enable you to deploy and enforce a collection of AWS Config rules and remediation actions across multiple accounts and Regions in an AWS Organization. They provide a centralized way to ensure that resources comply with internal policies by using a YAML template that defines the rules and parameters, which are then applied to all member accounts via AWS Config aggregators and StackSets.

Exam trap

The trap here is that candidates often confuse AWS CloudTrail (audit logging) with a policy enforcement tool, or assume AWS Systems Manager can centrally enforce security policies across accounts, when it is actually designed for operational tasks like patch management and automation, not policy governance.

784
Multi-Selecteasy

Which TWO measures can be taken to protect data at rest in Amazon S3? (Select TWO.)

Select 2 answers
A.Enable S3 Server-Side Encryption (SSE-S3 or SSE-KMS)
B.Enable cross-region replication
C.Enable MFA Delete on the bucket
D.Create a bucket policy that denies s3:PutObject without the x-amz-server-side-encryption header
E.Use S3 Transfer Acceleration
AnswersA, D

S3 Server-Side Encryption (SSE-S3 or SSE-KMS) transparently encrypts object data before it is written to disk and decrypts it when the object is read, using either S3-managed AES-256 keys or AWS KMS-managed customer keys. This ensures that objects stored in the bucket are unreadable without the appropriate decryption key, directly protecting data at rest. For SSE-KMS, the service also provides envelope encryption, key rotation, and fine-grained access control through IAM policies.

Why this answer

S3 Server-Side Encryption (SSE) and S3 Bucket Policies to deny unencrypted PUT requests are measures to protect data at rest. MFA Delete protects against accidental deletion, not encryption. Cross-region replication is for disaster recovery.

S3 Transfer Acceleration speeds up uploads.

785
MCQhard

A company runs a production application on Amazon ECS with Fargate, fronted by an Application Load Balancer (ALB). The application experiences periodic latency spikes and occasional 502 errors. The ECS service is configured with a desired count of 2 tasks, and the ALB health check is set to /health with a 30-second interval and 2 consecutive failures threshold. The team uses CloudWatch Container Insights and has noticed that CPU and memory utilization of tasks remain below 50%. However, the ALB TargetGroup's HealthyHostCount metric occasionally drops to 0 for a few minutes before recovering. The deployment strategy is rolling update with a minimum healthy percent of 50% and maximum percent of 200%. The team recently updated the task definition to increase memory and CPU, but the issue persists. What is the MOST likely cause of the problem?

A.The ECS service role lacks permissions to register targets with the ALB.
B.The ALB health check is too aggressive, causing tasks to be marked unhealthy during brief initialization or deployment.
C.The ALB target group is configured with only one Availability Zone, causing loss of all targets when that AZ fails.
D.The task's CPU or memory limits are set too low, causing the container to be throttled.
AnswerB

The health check interval (30 seconds) and failure threshold (2) mean it takes up to 60 seconds to mark a task unhealthy. During deployments, the rolling update may temporarily have only 1 healthy task (minimum 50% of 2 = 1), and if that task becomes unhealthy, HealthyHostCount drops to 0.

Why this answer

The health check interval (30 seconds) and failure threshold (2) mean it takes up to 60 seconds to mark a task unhealthy. During deployments, the rolling update may temporarily have only 1 healthy task (minimum 50% of 2 = 1), and if that task becomes unhealthy, HealthyHostCount drops to 0. Option A is wrong because CPU and memory are below 50%, so resource limits are not the issue.

Option C is wrong because a target group with 2 tasks and 2 AZs is fine; the problem is not AZ-specific. Option D is wrong because ECS service-linked role does not affect health checks.

786
MCQeasy

A company uses AWS OpsWorks to manage a set of EC2 instances. They need to ensure that a custom recipe runs on all instances during the 'Configure' lifecycle event. What is the correct way to achieve this?

A.Modify the stack's CloudFormation template to include the recipe.
B.Upload the recipe to a custom cookbook repository and assign it to the 'Configure' lifecycle event in the stack settings.
C.Add the recipe commands to the instance's user data script.
D.Use AWS CodeDeploy to trigger the recipe during the Configure event.
AnswerB

Upload the cookbook containing the recipe to a repository (S3, Git, or HTTP), then in the OpsWorks stack settings enable 'Use custom Chef cookbooks' and add the recipe name to the Configure lifecycle event. The OpsWorks agent then executes that recipe on every Configure event, which fires when any instance enters the online state or when instances are added to or removed from the stack. This is the documented, supported method for attaching custom configuration logic to OpsWorks lifecycle events.

Why this answer

In AWS OpsWorks, lifecycle events (such as Configure) are tied to layers, not individual instances. To run a custom recipe on all instances during the Configure event, you must upload the recipe to a custom cookbook repository (e.g., S3 or Git) and then assign that recipe to the Configure lifecycle event in the stack's layer settings. This ensures OpsWorks Chef runs the recipe on every instance in that layer whenever the Configure event fires (e.g., after scaling or instance state changes).

Exam trap

The trap here is that candidates confuse the one-time execution of user data scripts (Option C) with the recurring, event-driven nature of OpsWorks lifecycle events, or mistakenly think CloudFormation (Option A) or CodeDeploy (Option D) can directly manage OpsWorks recipe execution.

How to eliminate wrong answers

Option A is wrong because AWS OpsWorks does not use CloudFormation templates to define lifecycle recipes; OpsWorks uses Chef cookbooks and lifecycle event assignments within the stack/layer configuration. Option C is wrong because user data scripts run only once at instance boot, whereas the Configure lifecycle event fires repeatedly (e.g., on instance start, stop, or scaling), so a user data script cannot handle recurring Configure events. Option D is wrong because AWS CodeDeploy is a deployment service for application code, not a mechanism to trigger OpsWorks lifecycle events; it cannot directly invoke Chef recipes during the Configure event.

787
MCQeasy

A company is designing a disaster recovery strategy for its on-premises database to AWS using AWS Elastic Disaster Recovery (AWS DRS). The recovery time objective (RTO) is 15 minutes, and the recovery point objective (RPO) is 1 minute. Which configuration should they use?

A.Use AWS CloudEndure Disaster Recovery (now AWS DRS) with periodic replication every hour.
B.Use AWS Backup to take snapshots every 5 minutes and restore in the target region.
C.Use RDS cross-region automated backups with a 5-minute backup window.
D.Configure AWS DRS to continuously replicate data to a staging area in AWS, and launch instances in the target region on failover.
AnswerD

AWS DRS provides continuous block-level replication from source servers to a low-cost staging area in the AWS target Region, capturing every data change and maintaining a nearly synchronous copy. On failover, DRS automatically launches EC2 instances from the most recent consistent recovery point, achieving an RPO of seconds (well under the required 1 minute) and an RTO that can be measured in minutes. This directly meets the stated DR requirements, making it the correct choice.

Why this answer

AWS DRS (formerly CloudEndure) provides continuous block-level replication with sub-second RPO, which meets the 1-minute RPO requirement. By replicating to a staging area and launching instances in the target region on failover, it can achieve an RTO of 15 minutes or less, as the instances are pre-configured and ready for rapid launch.

Exam trap

The trap here is that candidates may confuse periodic backup solutions (like AWS Backup or RDS automated backups) with continuous replication, failing to recognize that only AWS DRS can achieve sub-minute RPO and rapid RTO for on-premises databases.

How to eliminate wrong answers

Option A is wrong because periodic replication every hour would result in an RPO of up to 60 minutes, far exceeding the required 1-minute RPO. Option B is wrong because AWS Backup snapshots every 5 minutes cannot achieve a 1-minute RPO, and restoring from snapshots typically takes longer than 15 minutes, failing the RTO. Option C is wrong because RDS cross-region automated backups have a minimum backup window of 5 minutes, which does not meet the 1-minute RPO, and this option is specific to RDS, not the on-premises database being migrated.

788
MCQhard

A DevOps engineer is troubleshooting an application running on an EC2 instance. The application needs to access an Amazon RDS database using IAM database authentication. The EC2 instance is associated with an IAM role 'EC2-AppRole', and the RDS instance has a resource-based policy that allows 'DatabaseAccessRole' to connect. The engineer sees the error in the exhibit. What is the most likely cause?

A.The RDS instance does not have a resource-based policy that grants access to 'DatabaseAccessRole'.
B.The security group for the EC2 instance does not allow outbound traffic to the RDS instance.
C.The EC2 instance does not have the correct IAM instance profile attached.
D.The trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it.
AnswerD

For IAM database authentication, the application must first assume the IAM role 'DatabaseAccessRole' to obtain credentials authorized to generate the RDS token; the trust policy on 'DatabaseAccessRole' must explicitly list 'EC2-AppRole' as a trusted principal. When this trust policy does not allow the EC2 instance's role to assume it, the STS AssumeRole call returns 'AccessDenied', so the application cannot acquire the token required for authentication to RDS. This exactly matches the observed error, confirming the trust policy of 'DatabaseAccessRole' is the root cause.

Why this answer

The error indicates that the EC2 instance's IAM role 'EC2-AppRole' cannot authenticate to the RDS instance. IAM database authentication requires the EC2 instance to assume a database authentication token, which is generated by calling the RDS API with the 'EC2-AppRole' credentials. However, the RDS instance's resource-based policy only allows 'DatabaseAccessRole' to connect.

For 'EC2-AppRole' to successfully authenticate, it must first assume 'DatabaseAccessRole' via a trust policy that permits the EC2 instance role to assume it. Without this trust relationship, the authentication token request fails, causing the error.

Exam trap

The trap here is that candidates often assume the error is due to missing resource-based policies or network connectivity, but the core issue is the missing trust relationship between the EC2 instance role and the database access role, which is a common misconfiguration in cross-account or cross-role IAM authentication setups.

How to eliminate wrong answers

Option A is wrong because the RDS instance does have a resource-based policy that allows 'DatabaseAccessRole' to connect, as stated in the question; the issue is that the EC2 instance role cannot assume that role. Option B is wrong because security group rules control network traffic, not IAM authentication; if the security group were blocking outbound traffic, the error would be a network timeout or connection refused, not an IAM authentication failure. Option C is wrong because the EC2 instance is already associated with the IAM role 'EC2-AppRole' (the instance profile is attached), and the error is about assuming another role, not about the instance lacking a role.

789
Multi-Selecthard

A company is designing a disaster recovery plan for an Amazon S3 data lake. The data lake stores sensitive data that must be replicated to a secondary Region with an RPO of 15 minutes. Which THREE actions should the company take? (Choose THREE.)

Select 3 answers
A.Enable S3 Versioning on both the source and destination buckets.
B.Enable S3 Replication Time Control (RTC) for the replication rule.
C.Configure cross-Region replication (CRR) from the source bucket to the destination bucket.
D.Configure S3 Event Notifications to trigger a Lambda function that copies objects to the secondary Region.
E.Enable S3 Transfer Acceleration on the source bucket.
AnswersA, B, C

S3 Versioning must be enabled on both the source and destination buckets because S3 Cross-Region Replication (CRR) requires versioned buckets to function. Versioning allows every object version, including overwrites and delete markers, to be captured and replicated, ensuring a complete and recoverable history in the DR Region. Without versioning, CRR cannot replicate updates or track deletes consistently, and the RPO guarantee would be unattainable.

Why this answer

Enabling S3 Versioning on both the source and destination buckets is a prerequisite for S3 Replication. Without versioning, replication cannot track object versions, which is essential for meeting the 15-minute RPO with consistency guarantees.

Exam trap

The trap here is that candidates may confuse S3 Event Notifications with Lambda as a viable replication method, overlooking that native CRR with RTC provides guaranteed RPO and versioning consistency without custom code overhead.

790
MCQeasy

A team uses AWS CodeBuild to build Docker images and push them to Amazon ECR. The buildspec.yml includes a post_build step that runs a security scan. The team wants to ensure that only images that pass the security scan are tagged as 'latest'. Which approach should be used?

A.Build the image with the 'latest' tag first, then run the security scan. If it fails, delete the 'latest' tag.
B.In the post_build phase, run the security scan, and if it passes, tag the image with 'latest' and push.
C.Use ECR lifecycle policies to remove images that do not pass the security scan.
D.Tag the image with 'latest' only after the build phase, regardless of scan results.
AnswerB

This is the correct approach because it guarantees the 'latest' tag is only ever applied to an image that has successfully passed the defined security gate. In the post_build phase of CodeBuild, you can run a local container scanner (e.g., Trivy, Snyk, or Anchore) and only when the exit code indicates a pass do you execute `docker tag` to relabel the built image as `latest` followed by `docker push`. This ensures the 'latest' tag remains immutable and clean, with no vulnerable image ever being exposed under that tag during the build or scan window.

Why this answer

It ensures that only images passing the security scan receive the 'latest' tag. By running the scan in the post_build phase and conditionally tagging only on success, the team avoids ever pushing a vulnerable image with the 'latest' tag. This approach follows the principle of atomic tagging, where the tag is applied only after all validation steps pass.

Exam trap

The trap here is that candidates may think deleting a tag after a failure is sufficient, but they overlook the race condition where the 'latest' tag is already published and could be consumed before deletion.

How to eliminate wrong answers

Option A is wrong because building the image with the 'latest' tag first and then deleting it on failure is not atomic; there is a window where the vulnerable image is already tagged and potentially pulled by consumers. Option C is wrong because ECR lifecycle policies are designed to automatically expire old or unused images based on age or count, not to react to security scan results in real time. Option D is wrong because tagging with 'latest' regardless of scan results defeats the purpose of the security gate, allowing vulnerable images to be promoted.

791
MCQeasy

A DevOps team is implementing infrastructure as code using AWS CloudFormation. They want to ensure that stack updates are reviewed and approved before execution. Which feature should they use?

A.Drift detection
B.Stack policies
C.StackSets
D.Change Sets
AnswerD

Change Sets in AWS CloudFormation generate a read-only summary of the exact resource-level actions (Update, Add, Remove) that would result from submitting a new template or parameters. They act as a dry-run, allowing the team to inspect the proposed modifications, identify resources that will be replaced, and evaluate potential downtime before executing the stack update. This review-and-approve capability makes Change Sets the ideal tool for implementing infrastructure as code with controlled change management.

Why this answer

Change Sets allow you to preview the proposed changes to a CloudFormation stack before executing them. This enables the DevOps team to review and approve modifications, ensuring that only validated updates are applied. By creating a change set, you can see exactly which resources will be added, modified, or deleted, and then decide whether to execute it.

Exam trap

The trap here is that candidates confuse stack policies (which control update permissions) with change sets (which provide a preview and approval workflow), leading them to select stack policies as the mechanism for review and approval.

How to eliminate wrong answers

Option A is wrong because drift detection identifies whether a stack's actual state differs from its template, but it does not provide a mechanism to review or approve updates before execution. Option B is wrong because stack policies define which resources can be updated or replaced during a stack update, but they do not offer a review-and-approve workflow for changes. Option C is wrong because StackSets enable you to create, update, or delete stacks across multiple accounts and regions, but they do not provide a per-update review and approval process.

792
MCQhard

An organization manages multiple AWS accounts using AWS Organizations. They want to use AWS CloudFormation StackSets to deploy a standard VPC configuration across all accounts. However, some accounts require specific CIDR blocks that differ from the default. What is the most efficient way to handle this variation?

A.Create separate StackSets for each CIDR range and assign accounts accordingly.
B.Create a nested stack for each account that overrides the default parameters.
C.Use a single StackSet with parameters and pass account-specific parameter files via AWS CloudFormation parameter overrides in the StackSet instance.
D.Maintain separate templates per account with hardcoded CIDR blocks.
AnswerC

A single StackSet with a common template and per-account parameter overrides is the intended pattern for account-specific values like CIDR blocks. You can attach overrides to individual stack instances via CreateStackInstances or UpdateStackInstances, so each account receives the same standard security and network rules but with the exact CIDR range it needs, all through one API call. This approach centralizes updates and drift management—changing a rule once updates every account—while preserving per-account flexibility, and it integrates natively with Organizations' delegated administrator and automatic deployment for new accounts.

Why this answer

AWS CloudFormation StackSets support parameter overrides at the stack instance level, allowing you to deploy a single StackSet template across multiple accounts while specifying account-specific CIDR blocks without duplicating infrastructure. This approach minimizes management overhead by using one template and one StackSet, with parameter overrides applied per target account or organizational unit (OU) via the StackSet instance configuration.

Exam trap

The trap here is that candidates often confuse StackSet parameter overrides with nested stacks or separate templates, not realizing that StackSets natively support per-instance parameter values without requiring multiple StackSets or template duplication.

How to eliminate wrong answers

Option A is wrong because creating separate StackSets for each CIDR range defeats the purpose of using StackSets for centralized management, leading to operational complexity and increased maintenance burden. Option B is wrong because nested stacks are not designed to override parameters per account in a StackSet; they are used for modular template composition, not for passing account-specific values across multiple StackSet instances. Option D is wrong because maintaining separate templates per account with hardcoded CIDR blocks violates IaC best practices, introduces drift risk, and eliminates the reusability and consistency that StackSets provide.

793
Drag & Dropmedium

Drag and drop the steps to set up an AWS CodeBuild project to build a Docker image and push it to Amazon ECR.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

The correct order to set up an AWS CodeBuild project for building a Docker image and pushing to Amazon ECR is: first create the ECR repository, then write the buildspec.yml file, then create the CodeBuild project with privileged mode enabled, and finally start the build. This sequence ensures the repository exists, the build specification is ready, and the project has the necessary permissions to build and push the Docker image.

794
MCQmedium

A company uses an Auto Scaling group with a dynamic scaling policy based on a custom CloudWatch metric. After a recent deployment, the metric spikes unexpectedly, causing the Auto Scaling group to launch several EC2 instances. The operations team wants to quickly determine whether the spike was caused by a real load increase or a deployment issue. What is the MOST efficient way to investigate this?

A.Check the SNS topic that the scaling policy publishes to for notifications.
B.Use CloudWatch Logs Insights to query application logs for error patterns or deployment markers that coincide with the metric spike.
C.Use AWS CloudTrail to review API calls that modified the scaling policy.
D.Temporarily disable the scaling policy and manually increase the desired capacity to handle the load.
AnswerB

CloudWatch Logs Insights lets you run SQL-like queries against application logs stored in CloudWatch Logs, allowing you to filter for specific error codes, exception stack traces, or deployment markers that align with the exact timestamp of the metric spike. By correlating log timestamps with the scaling activity, you can identify events like a failed code release, a dependency outage, or a traffic surge that pushed the metric above the alarm threshold. This is the only option that gives access to application-level evidence needed to diagnose the upstream cause of the spike.

Why this answer

CloudWatch Logs Insights allows you to query application logs for error patterns or deployment markers (e.g., new version tags, exception stack traces) that coincide with the metric spike. This directly correlates the scaling event with application-level evidence, enabling rapid root-cause analysis without altering infrastructure or relying on indirect notifications.

Exam trap

The trap here is that candidates confuse monitoring scaling actions (SNS/CloudTrail) with diagnosing the metric's root cause, overlooking that application logs provide the direct evidence needed to distinguish real load from deployment issues.

How to eliminate wrong answers

Option A is wrong because SNS topics used by scaling policies only send notifications about scaling actions (e.g., instance launched), not the underlying cause of the metric spike; they lack application-level context. Option C is wrong because AWS CloudTrail records API calls that modify the scaling policy (e.g., PutScalingPolicy), but the metric spike itself is not an API call—it is a CloudWatch metric data point, so CloudTrail cannot show why the metric changed. Option D is wrong because temporarily disabling the scaling policy and manually increasing desired capacity is a reactive workaround that does not investigate the root cause; it masks the symptom and risks over-provisioning or missing a deployment bug.

795
MCQeasy

A DevOps engineer needs to set up a monitoring solution for an AWS Lambda function that processes messages from an Amazon SQS queue. The engineer wants to be alerted if the function fails to process a message (i.e., the message ends up in the dead-letter queue). Which approach should they use?

A.Create a CloudWatch alarm on the ApproximateNumberOfMessagesVisible metric of the dead-letter queue.
B.Enable CloudTrail to log SQS API calls and create a metric filter for SendMessage to the DLQ.
C.Create a CloudWatch Events rule to monitor the Lambda function errors.
D.Configure the Lambda function's dead-letter queue to send notifications via Amazon SNS.
AnswerA

The ApproximateNumberOfMessagesVisible metric of the dead-letter queue is a native SQS metric that reports the number of messages available for retrieval. When the redrive policy moves messages from the source queue to the DLQ after the maximum receive count is exceeded, this metric immediately increases. Creating a CloudWatch alarm on this metric provides a direct, near-real-time signal that messages are failing processing, and you can trigger an SNS notification or other action from the alarm.

Why this answer

The `ApproximateNumberOfMessagesVisible` metric on the dead-letter queue (DLQ) directly reflects the number of messages that have failed processing and been moved there. By creating a CloudWatch alarm on this metric (e.g., when it exceeds 0 for a period), the engineer receives an alert precisely when messages are failing, without needing to parse logs or rely on indirect indicators.

Exam trap

The trap here is that candidates often confuse monitoring Lambda function errors (Option C) with monitoring DLQ messages, not realizing that a message can end up in the DLQ due to exhaustion of retries (configured in the SQS event source mapping) without the Lambda function itself throwing an error.

How to eliminate wrong answers

Option B is wrong because CloudTrail logs SQS API calls (like SendMessage) but does not provide a real-time metric for DLQ message count; creating a metric filter on SendMessage to the DLQ would require parsing every API call and does not natively aggregate to a simple alarm threshold. Option C is wrong because monitoring Lambda function errors (e.g., via CloudWatch Events or Lambda metrics) captures function invocation failures but does not specifically indicate that a message was sent to the DLQ—messages can fail processing without a Lambda error (e.g., if the function returns an error but the SQS trigger retries and eventually sends to DLQ). Option D is wrong because configuring the Lambda function's DLQ to send notifications via SNS would require custom code or configuration to publish a notification each time a message is moved to the DLQ, which is not a built-in feature of SQS or Lambda; SNS can be used as a target for DLQ messages only if the DLQ itself is an SNS topic, but SQS DLQs are queues, not topics, and SNS does not automatically emit notifications when messages are added to an SQS queue.

796
MCQeasy

An application running on Amazon EC2 instances sends custom metrics to CloudWatch. The team notices that some metrics are not appearing. What is the most likely cause?

A.The custom metric namespace is not pre-registered in CloudWatch.
B.The EC2 instances are in a private subnet without a NAT gateway.
C.The IAM role attached to the EC2 instance lacks permissions to publish metrics.
D.The CloudWatch agent is not installed or configured on the EC2 instances.
AnswerD

Custom metrics are not emitted by default by EC2; they require an explicit mechanism such as the CloudWatch agent or direct PutMetricData calls from the application. If the agent is not installed or its configuration file (common for statsd or collectd) is missing/invalid, no metric data will be sent even though the application is running. This is the most common root cause when an application expects to send custom metrics but nothing appears in CloudWatch, because without the agent’s collection loop, nothing triggers the metric submission.

Why this answer

The most likely cause is that the CloudWatch agent is not installed or configured on the EC2 instances. Custom metrics require the CloudWatch agent to collect and send data to CloudWatch. Option A is incorrect because custom metric namespaces do not need to be pre-registered; they are automatically created when metrics are published.

Option B is incorrect because instances in a private subnet can still publish metrics using a VPC endpoint or a proxy, so a NAT gateway is not strictly required. Option C is incorrect because even with proper IAM permissions, the CloudWatch agent must be installed and running to collect and send custom metrics. Therefore, option D is correct.

797
MCQeasy

A DevOps engineer is configuring AWS CloudTrail to log all management events across all regions. The engineer wants to ensure that log files are encrypted at rest using a customer-managed KMS key. What is the correct way to achieve this?

A.Use SSE-C with a customer-provided key when uploading logs to S3.
B.Enable client-side encryption before delivering logs to S3.
C.Enable default encryption on the S3 bucket using SSE-S3.
D.Specify a KMS key ID in the CloudTrail trail configuration and grant CloudTrail permissions to use the key.
AnswerD

CloudTrail natively supports SSE-KMS: you configure the trail by specifying a KMS key ID (e.g., arn:aws:kms:region:account:key/key-id) and you must also grant CloudTrail the required permissions via the KMS key policy—specifically kms:GenerateDataKey and kms:Decrypt on the key. This lets CloudTrail encrypt each log file with a customer-managed AWS KMS key, giving you full lifecycle control, auditability, and the ability to disable or rotate the key as needed. Unlike SSE-S3 or SSE-C, this is the only option that both supports automated delivery and uses a customer-managed key.

Why this answer

AWS CloudTrail supports encryption at rest using a customer-managed AWS KMS key (SSE-KMS). To achieve this, you must specify the KMS key ID in the CloudTrail trail configuration and grant CloudTrail permissions to use that key via the key policy. Option A is wrong because CloudTrail does not support SSE-C (customer-provided keys); it only supports SSE-S3 or SSE-KMS.

Option B is wrong because client-side encryption is not a built-in CloudTrail feature and would require custom implementation. Option C is wrong because SSE-S3 uses S3-managed keys, not a customer-managed KMS key. Therefore, D is the only correct way to encrypt CloudTrail logs with a customer-managed KMS key.

798
MCQeasy

A DevOps engineer is using AWS OpsWorks for configuration management. They need to ensure that custom recipes are applied to all instances in a layer in a specific order. What should the engineer do?

A.Assign the recipes to the appropriate lifecycle events in the layer configuration.
B.Use AWS CloudFormation Init with cfn-init to order the scripts.
C.Include all recipes in a single wrapper recipe and use include_recipe with the desired order.
D.Add the recipes to the instance's user data script.
AnswerA

Assigning recipes to lifecycle events is the native OpsWorks Stacks mechanism for ordered configuration. Each layer exposes five lifecycle events (Setup, Configure, Deploy, Undeploy, Shutdown), and recipes attached to an event execute in the order listed within that event's configuration. This provides a predictable, sequential run across all instances in the layer, ensuring that prerequisites and dependencies are satisfied. Because OpsWorks orchestrates these events centrally, this is the only option that reliably enforces both per-instance ordering and layer-wide sequencing.

Why this answer

AWS OpsWorks uses lifecycle events (Setup, Configure, Deploy, Undeploy, Shutdown) to control when custom recipes run on instances within a layer. By assigning recipes to the appropriate lifecycle events in the layer configuration, the engineer ensures they execute in the defined order for that event across all instances in the layer, which is the native mechanism for ordering in OpsWorks.

Exam trap

The trap here is that candidates may confuse OpsWorks lifecycle events with Chef's include_recipe directive, assuming that ordering within a wrapper recipe is sufficient, when OpsWorks actually enforces order through lifecycle event assignments.

How to eliminate wrong answers

Option B is wrong because AWS CloudFormation Init with cfn-init is used for bootstrapping EC2 instances in CloudFormation stacks, not for managing recipe execution order within an OpsWorks layer, which is a separate configuration management service. Option C is wrong because while include_recipe can be used in Chef to include other recipes, placing all recipes in a single wrapper recipe does not inherently enforce a specific order across lifecycle events; OpsWorks relies on lifecycle event assignments to control execution sequence, not Chef's include_recipe order alone. Option D is wrong because user data scripts run only at instance launch and are not integrated with OpsWorks lifecycle events; they cannot manage the ordered execution of custom recipes across the instance's operational lifecycle.

799
Multi-Selecteasy

Which TWO criteria must be met for an AWS CloudFormation stack update to be successful? (Choose 2.)

Select 2 answers
A.The update template must be valid and must not contain any syntax errors.
B.The stack must be in a steady state with no previous failed updates.
C.The stack must be in a state that allows updates (e.g., CREATE_COMPLETE, UPDATE_COMPLETE).
D.A change set must be created and executed before the update.
E.The stack must have no drift detected.
AnswersA, C

CloudFormation performs template validation before any update action is taken, checking for well-formed JSON/YAML, resolving intrinsic functions, validating resource types and required properties. An invalid template will cause the UpdateStack API call to fail immediately with a ValidationError, leaving the stack's current status unchanged. This is a hard precondition that every direct update must satisfy.

Why this answer

AWS CloudFormation validates the template syntax and structure before initiating any stack update. If the template contains invalid JSON or YAML, references nonexistent resources, or violates intrinsic function rules, the update request is rejected immediately. This validation ensures that only syntactically correct templates proceed to the update operation.

Exam trap

The trap here is that candidates confuse 'stack must be in a steady state' (a common misconception) with the actual requirement that the stack must be in a state that allows updates, such as CREATE_COMPLETE or UPDATE_COMPLETE, not necessarily without any prior failures.

800
MCQmedium

A DevOps team uses AWS CodeCommit and AWS CodePipeline for CI/CD. They need to ensure that sensitive configuration parameters such as database passwords are not stored in plaintext in the source code repository. Which solution meets these requirements with minimal operational overhead?

A.Store the parameters in a separate encrypted Git repository and use Git submodules.
B.Use AWS KMS to encrypt the parameters and include the encrypted blob in the source code.
C.Store the parameters in an S3 bucket with server-side encryption, and have the pipeline download them.
D.Use AWS Systems Manager Parameter Store with secure strings, and reference them in the pipeline using parameter-store action.
AnswerD

AWS Systems Manager Parameter Store with a SecureString parameter encrypts the secret under a KMS customer managed key and lets CodePipeline or CodeBuild retrieve it directly as an environment variable at build time, without the secret ever appearing in the source repository or build artifact. Because access is controlled via IAM, you can scope which pipelines see which secrets, and you can rely on Parameter Store’s native versioning to rotate values without triggering a pipeline rebuild.

Why this answer

AWS Systems Manager Parameter Store with secure strings provides a native, fully managed service for storing sensitive configuration data like database passwords. By using the parameter-store action in CodePipeline, the pipeline can retrieve the secure parameter at runtime without exposing it in the source code or requiring manual encryption/decryption logic, minimizing operational overhead.

Exam trap

The trap here is that candidates may think storing an encrypted blob in the repository (Option B) is acceptable because it is 'encrypted,' but the exam tests the principle that secrets should never be stored in the source code repository at all, even in encrypted form, due to key management and exposure risks.

How to eliminate wrong answers

Option A is wrong because maintaining a separate encrypted Git repository and using Git submodules adds significant complexity, does not natively integrate with CodePipeline, and still risks exposing sensitive data in the submodule reference or during cloning. Option B is wrong because including an encrypted blob in the source code requires manual key management and decryption logic in the pipeline, and the encrypted blob itself is still stored in the repository, which violates the principle of not storing secrets in the codebase. Option C is wrong because storing parameters in an S3 bucket with server-side encryption requires additional pipeline steps to download the file, manage bucket permissions, and handle potential race conditions or stale data, increasing operational overhead compared to a direct parameter store reference.

801
Multi-Selectmedium

A DevOps team is implementing a CI/CD pipeline for a microservices architecture. Each microservice is built and deployed independently. The team wants to ensure that only one build runs per microservice at a time to avoid resource contention, and that the build artifacts are stored securely. Which THREE steps should the team take?

Select 3 answers
A.Store build artifacts in AWS CodeArtifact
B.Enable versioning on the S3 bucket storing build artifacts
C.Configure a concurrency limit in the CodeBuild project for each microservice
D.Create a separate CodePipeline for each microservice
E.Enable server-side encryption on the S3 bucket storing build artifacts
AnswersB, C, E

Enabling S3 bucket versioning on the bucket that stores CodePipeline build artifacts preserves every object version, including each build output. When a deployment needs to roll back, you can retrieve a previous artifact version directly from S3 or point the pipeline stage to that exact version. Versioning is a prerequisite for using S3 as CodePipeline's default artifact store in a way that supports safe, reproducible rollbacks without losing prior builds.

Why this answer

Option B is correct because enabling versioning on the S3 bucket preserves every revision of the build artifacts, allowing recovery of previous versions and protecting against accidental overwrites or deletions, which supports secure artifact storage. Option C is correct because configuring a concurrency limit in each microservice's CodeBuild project ensures only one build for that microservice runs at a time, directly preventing resource contention as required. Option E is correct because enabling server-side encryption on the S3 bucket encrypts artifacts at rest using AWS-managed or KMS keys, satisfying the requirement to store build artifacts securely.

Option A is not correct because AWS CodeArtifact is a package/dependency repository for artifacts like npm, Maven, and PyPI packages, not the general build-artifact store used by CodePipeline, and the scenario's secure storage requirement is met by S3 with versioning and encryption. Option D is not correct because creating a separate CodePipeline per microservice supports independent deployment but does not by itself enforce one build at a time or secure artifact storage.

Exam trap

The trap here is that candidates often confuse AWS CodeArtifact (for package management) with S3 (for artifact storage), or they assume that creating separate pipelines inherently enforces concurrency limits, when in fact concurrency must be explicitly configured in the CodeBuild project settings.

802
MCQhard

A company runs a critical application on EC2 instances behind an Application Load Balancer. The application uses an Amazon RDS for PostgreSQL Multi-AZ DB instance. During a recent failover test, the application experienced a 5-minute downtime. The RDS failover completed within 30 seconds. What is the most likely cause of the prolonged downtime?

A.The application caches DNS resolutions, causing it to connect to the old writer endpoint
B.The RDS Multi-AZ failover took longer than expected due to a large transaction log
C.The Application Load Balancer health checks marked all instances as unhealthy during the failover
D.The application was using read replicas for writes, which failed during failover
AnswerA

After a Multi-AZ failover, the RDS DNS record for the writer endpoint is updated to point to the new primary instance, but an application that caches DNS resolutions continues sending write connections to the old IP. That old IP belongs to the former primary, which is now promoted to standby (or replaced) and will not accept write connections, so all new database requests fail until the TTL expires or the application is restarted. This directly causes the five-minute outage because the application never re-resolves the endpoint until the cached entry times out.

Why this answer

The most likely cause is that the application caches DNS resolutions, causing it to continue connecting to the old writer endpoint after failover. When an RDS Multi-AZ failover occurs, the DNS record for the writer endpoint is updated to point to the new primary instance, but the application's cached DNS entry still points to the old IP address. Since the old primary is now a standby and no longer accepts connections, the application experiences downtime until the DNS cache expires (typically 5–60 seconds) or the application refreshes the DNS resolution.

The 5-minute downtime suggests the application uses a long DNS TTL or a custom caching layer that delays reconnection.

Exam trap

The trap here is that candidates assume the 5-minute downtime must be caused by the database failover itself, but the question explicitly states the failover completed in 30 seconds, so the real issue is application-side DNS caching or stale connection handling.

How to eliminate wrong answers

Option B is wrong because the scenario explicitly states the RDS failover completed within 30 seconds, so a large transaction log did not cause the prolonged downtime. Option C is wrong because the Application Load Balancer health checks are independent of RDS failover; even if the database is briefly unavailable, the ALB does not mark instances unhealthy unless the application itself fails health checks due to database connectivity issues. Option D is wrong because read replicas are not used for writes in a standard RDS Multi-AZ setup; writes always go to the primary instance, and read replicas are read-only, so this scenario does not apply.

803
MCQmedium

A development team uses AWS CodeCommit for source control. They want to enforce that all commits include a JIRA issue key in the commit message. What is the MOST efficient way to achieve this?

A.Use Amazon CloudWatch Events to detect new commits and invoke a Lambda function to validate the commit message.
B.Implement a pre-commit hook in each developer's local repository.
C.Configure a branch policy on the repository that requires commit message format.
D.Create a CodeCommit trigger that invokes an AWS Lambda function on every push to validate commit messages.
AnswerD

A CodeCommit trigger can be set up to invoke an AWS Lambda function whenever a push event occurs, and the event payload includes the full commit list with metadata such as the commit message and author. The Lambda function can programmatically validate each commit message against a required format or regex, and then take action such as sending an alert or invoking a rollback if validation fails. This is a serverless, centrally managed approach that runs on every push and cannot be bypassed by developers, making it the correct solution.

Why this answer

CodeCommit triggers can invoke an AWS Lambda function on every push event, allowing real-time validation of commit messages against a required pattern (e.g., JIRA issue key). This serverless approach enforces the policy centrally without relying on client-side configurations, making it the most efficient and reliable method for a team using AWS CodeCommit.

Exam trap

The trap here is that candidates confuse CodeCommit branch policies (which enforce approval workflows and restrict direct pushes) with the ability to validate commit message format, but branch policies do not support message validation—only CodeCommit triggers with Lambda can perform custom validation on commit content.

How to eliminate wrong answers

Option A is wrong because Amazon CloudWatch Events can detect CodeCommit events, but invoking a Lambda function via CloudWatch Events adds unnecessary complexity and latency compared to using a native CodeCommit trigger, which is designed for this exact purpose. Option B is wrong because a pre-commit hook in each developer's local repository is client-side and can be bypassed or not configured by all developers, failing to enforce the policy centrally. Option C is wrong because CodeCommit branch policies can enforce approval rules and restrict direct pushes, but they do not support validating commit message format; that capability is not available in CodeCommit branch policies.

804
MCQhard

A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application uses sticky sessions (session affinity) based on cookies. During a deployment, the DevOps engineer notices that some users are being logged out and losing session data. The deployment uses a rolling update strategy. What is the MOST likely cause?

A.The Auto Scaling group is terminating instances before the new ones are fully ready.
B.The health check interval is too long, causing the ALB to route traffic to unhealthy instances.
C.The ALB sticky session cookie is not being generated correctly.
D.The session data is stored locally on the EC2 instance, not in a shared external store.
AnswerD

Because the web application stores its session state locally—either in memory (e.g., a servlet HttpSession) or on the instance's ephemeral disk—any instance replacement destroys active sessions. During a rolling update, the Auto Scaling group terminates old instances after launching new ones, forcing users who had sessions on those instances to be logged out. Moving session data to a shared external store such as ElastiCache for Redis, DynamoDB, or a central database makes sessions independent of instance lifecycle and prevents this behavior.

Why this answer

Sticky sessions on the ALB bind a user to a specific EC2 instance via a cookie (AWSALB). If session data is stored locally on that instance, terminating the instance during a rolling update destroys the session data, logging the user out. The correct fix is to externalize session state to a shared store like ElastiCache, DynamoDB, or a database so any instance can serve any user.

Exam trap

The trap is blaming the deployment strategy or health checks when the real issue is architectural — local session storage is incompatible with elastic, stateless compute.

How to eliminate wrong answers

Option A is wrong because while premature termination could cause issues, the question specifies a rolling update strategy where instances are replaced gradually — the root cause is that session data is not shared, so even a properly executed rolling update loses sessions. Option B is wrong because a long health check interval would delay detection of unhealthy instances, not cause session loss during a rolling update; the ALB would still route to healthy instances. Option C is wrong because if the ALB sticky session cookie were not generated correctly, users would be load-balanced randomly from the start, not just during deployment — and the symptom would be inconsistent sessions, not logout during updates.

805
MCQmedium

A company uses AWS CloudFormation to deploy a web application across multiple AWS accounts using StackSets. The DevOps team notices that stack instance updates are failing in some accounts with the error: 'Insufficient IAM permissions to perform the action'. The team has already verified that the StackSet IAM role has the necessary permissions. What is the most likely cause of this issue?

A.The target accounts have reached the limit of 200 stacks per region.
B.The target accounts do not have the necessary trust policy to allow the StackSet IAM role to assume the execution role.
C.AWS Organizations has a service control policy (SCP) that denies the required action, but the StackSet IAM role has full admin permissions.
D.The StackSet name contains invalid characters that are not allowed in some accounts.
AnswerB

AWS CloudFormation StackSets require a trust relationship between the IAM role used to administer the StackSet (in the management account) and an execution role in each target account. If the execution role’s trust policy does not include the StackSet IAM role (or the appropriate account) as a trusted principal, the sts:AssumeRole call fails with an access-denied error. This trust policy is what authorizes the management account’s role to assume the target execution role, so its absence directly produces the reported failure.

Why this answer

StackSets require a trust relationship between the StackSet IAM role (in the management account) and an execution role in each target account. Even if the StackSet IAM role has full permissions, the target accounts must have a trust policy that allows the StackSet IAM role to assume the execution role. Without this trust policy, the assumption fails, resulting in the 'Insufficient IAM permissions' error.

Exam trap

The trap here is that candidates often assume the error is due to missing permissions on the StackSet IAM role itself, but the DOP-C02 exam tests the understanding that StackSets require a trust chain where the target account's execution role must explicitly trust the management account's StackSet IAM role.

How to eliminate wrong answers

Option A is wrong because the error message specifically mentions IAM permissions, not stack limits; reaching the 200-stack limit would produce a limit exceeded error, not an IAM permissions error. Option C is wrong because SCPs can deny actions even if the IAM role has full admin permissions, but the question states the team verified the StackSet IAM role has necessary permissions, and the error is about IAM permissions, not SCP denials; however, SCPs would cause a different error (e.g., 'Action denied by service control policy'), and the scenario points to a trust policy issue. Option D is wrong because StackSet names have character restrictions that are validated at creation time, not during updates, and invalid characters would cause a creation failure, not an update permission error.

806
Multi-Selecthard

Which TWO actions should a DevOps engineer take to ensure that an AWS CodeBuild project's artifacts are automatically deployed to an Amazon S3 bucket with server-side encryption using AWS KMS? (Choose 2.)

Select 2 answers
A.Enable versioning on the S3 bucket.
B.Configure the S3 bucket policy to require HTTPS for all uploads.
C.In the buildspec.yaml, set the 'artifacts' section to include 'encryptionDisabled: false' and specify the KMS key ID.
D.Enable default encryption on the S3 bucket using SSE-KMS.
E.Grant the CodeBuild service role permission to use the KMS key via the key policy.
AnswersC, E

In the buildspec.yaml, the artifacts section can set 'encryptionDisabled: false' and specify the desired KMS key ID via the 'kmsKeyId' setting (or similarly named property). This explicitly instructs CodeBuild to encrypt the output artifact using the specified customer-managed KMS key, ensuring server-side encryption at rest. This is the direct and reliable way to enforce SSE-KMS for build artifacts.

Why this answer

Setting 'encryptionDisabled: false' in the buildspec.yaml artifacts section explicitly enables encryption for the build output, and specifying the KMS key ID ensures that the artifacts are encrypted with that specific AWS KMS key. This configuration directly instructs CodeBuild to use server-side encryption with AWS KMS when uploading artifacts to S3.

Exam trap

The trap here is that candidates often confuse default bucket encryption (Option D) with explicit artifact encryption in CodeBuild, not realizing that CodeBuild's buildspec encryption settings override bucket defaults and that the service role must have explicit KMS key permissions.

807
MCQeasy

A DevOps engineer is troubleshooting an issue where an Amazon RDS for MySQL instance is experiencing high latency. The engineer wants to identify which queries are causing the problem. Which AWS service should be used?

A.Amazon RDS Performance Insights
B.AWS CloudTrail
C.Amazon CloudWatch Metrics
D.VPC Flow Logs
AnswerA

Amazon RDS Performance Insights is the correct choice because it is a dedicated database performance tuning feature that visualizes database load and provides granular, per-query metrics. It breaks down DB load by wait events, SQL statements, and hosts, directly surfacing the exact query text and execution statistics (e.g., rows returned, latency) causing high load. This allows a DevOps engineer to identify problematic queries quickly, unlike network or API-level logs.

Why this answer

Amazon RDS Performance Insights is a database performance tuning tool that visualizes database load (Average Active Sessions) broken down by SQL statement, wait event, user, and host. It directly identifies which queries are consuming the most DB load, making it the correct tool for diagnosing high-latency MySQL workloads. It retains up to 7 days of free performance data and up to 2 years with paid retention.

Exam trap

DOP-C02 often tests the distinction between control-plane logging (CloudTrail), infrastructure metrics (CloudWatch), and database-level query analytics (Performance Insights) — candidates confuse CloudWatch Metrics with query-level diagnostics.

How to eliminate wrong answers

Option B is wrong because AWS CloudTrail records API-level control-plane activity (who called CreateDBInstance, etc.), not SQL query execution or database performance. Option C is wrong because CloudWatch Metrics provides aggregate database metrics like CPUUtilization, FreeableMemory, and ReadIOPS — useful for spotting resource pressure but not for attributing latency to specific queries. Option D is wrong because VPC Flow Logs capture IP-level network metadata (source/dest IP, ports, bytes), not database query behavior.

808
Multi-Selecthard

A company uses AWS CloudFormation to deploy a multi-tier application. The stack creation fails with a 'CREATE_FAILED' error for a resource. The engineer wants to troubleshoot the issue. Which TWO steps should the engineer take? (Choose TWO.)

Select 2 answers
A.Use the 'describe-stack-events' AWS CLI command to view the events.
B.Review the CloudWatch Logs log group for the stack to find detailed error logs.
C.Check the 'ResourceStatusReason' field of the failed resource in the stack events.
D.Run 'delete-stack' to remove the failed stack and start over.
E.Use the 'describe-stacks' AWS CLI command to get the stack outputs.
AnswersA, C

The describe-stack-events AWS CLI command is the correct programmatic way to inspect the full event history of a stack, including each resource's CREATE_FAILED event followed by the overall stack rollback event. Each event object contains a ResourceStatusReason property with the detailed error thrown by the failed resource, along with the logical resource ID, physical resource ID, and timestamps. This command is ideal for automation because it returns the exact same failure information you would see in the CloudFormation console, allowing you to log or alert on the root cause.

Why this answer

The 'describe-stack-events' AWS CLI command retrieves all stack events, including the specific event for the failed resource. This event contains the 'ResourceStatusReason' field, which provides the detailed error message from CloudFormation explaining why the resource creation failed. Option C is correct because checking the 'ResourceStatusReason' field in the stack events directly reveals the underlying error.

Option B is incorrect because CloudFormation does not automatically create a CloudWatch Logs log group for stack errors; resource-specific logs are only available if the resource itself writes to CloudWatch. During a stack creation failure, there may be no such logs to review. Option D is incorrect because deleting the stack would lose the event history and prevent effective troubleshooting.

Option E is incorrect because 'describe-stacks' only returns stack outputs and status, not failure details.

Exam trap

The main trap is that candidates may incorrectly think that CloudFormation automatically creates a CloudWatch Logs log group for all stack errors (Option B), or prematurely delete the stack (Option D) instead of investigating the failure using stack events and the ResourceStatusReason field.

809
MCQmedium

A company is using Amazon RDS for PostgreSQL and wants to monitor the database for performance issues. They need to capture slow queries and analyze them over time. Which combination of AWS services should they use?

A.Enable RDS Event notifications to send alerts for performance issues.
B.Enable RDS Performance Insights and Enhanced Monitoring.
C.Enable CloudWatch Logs for PostgreSQL and export logs to Amazon S3.
D.Use CloudWatch Metrics to monitor database connections and CPU utilization.
AnswerB

RDS Performance Insights is the correct approach because it provides a database-load dashboard that correlates wait events, SQL statements, and hosts in real time, allowing you to pinpoint the exact queries causing bottlenecks. Enhanced Monitoring complements this by delivering OS-level metrics—including CPU, memory, file I/O, and process lists—from the underlying hypervisor, which helps identify resource saturation that affects query performance. Together, these services give both the query-level and system-level telemetry required to diagnose slow PostgreSQL performance.

Why this answer

RDS Performance Insights provides a database performance schema with detailed wait events and SQL-level metrics to identify slow queries, while Enhanced Monitoring offers OS-level metrics (CPU, memory, disk I/O) at sub-minute granularity. Together, they allow you to capture and analyze slow queries over time without additional log parsing or export overhead.

Exam trap

The trap here is that candidates often confuse general monitoring (CloudWatch Metrics) or log export (CloudWatch Logs to S3) with the specialized, integrated performance analysis tools (Performance Insights and Enhanced Monitoring) that are purpose-built for diagnosing slow queries in RDS.

How to eliminate wrong answers

Option A is wrong because RDS Event notifications only send alerts for instance lifecycle events (e.g., failover, maintenance) and do not capture or analyze slow query performance data. Option C is wrong because exporting PostgreSQL logs to S3 via CloudWatch Logs provides raw log files, but requires additional tooling (e.g., Athena) to parse and analyze slow queries; it is not a native, integrated solution for ongoing performance analysis. Option D is wrong because CloudWatch Metrics for database connections and CPU utilization provide aggregate resource metrics, not the detailed query-level or wait-event data needed to identify and analyze slow queries.

810
MCQeasy

A company uses AWS CloudTrail to log API activity in their AWS account. They need to ensure that any changes to CloudTrail configuration itself are detected and alerted upon in real time. Which service should they use?

A.Use Amazon CloudWatch Events (EventBridge) to create a rule matching the StopLogging or UpdateTrail API calls.
B.Enable AWS Config rules to monitor CloudTrail configuration changes.
C.Use Amazon CloudWatch Logs Insights to query CloudTrail logs for changes.
D.Enable Amazon GuardDuty to detect changes to CloudTrail.
AnswerA

EventBridge rules match CloudTrail management events by API name, so a rule filtering StopLogging and UpdateTrail invokes a target such as SNS within seconds of the call. This delivers the real-time detection of tampering with CloudTrail's own configuration that the scenario requires.

Why this answer

Amazon CloudWatch Events (EventBridge) can monitor CloudTrail API calls in real time by creating a rule that matches specific API calls such as StopLogging or UpdateTrail. When these calls are made, the rule triggers an action (e.g., SNS notification or Lambda function) to alert administrators immediately. This provides the real-time detection required for changes to CloudTrail configuration itself.

Exam trap

The trap here is that candidates often confuse AWS Config (which is for compliance and configuration history) with real-time event-driven alerting, or they think GuardDuty covers all security monitoring, but neither provides the specific real-time API call detection that EventBridge offers.

How to eliminate wrong answers

Option B is wrong because AWS Config rules are designed for continuous compliance assessment and configuration auditing, not real-time event-driven alerting; they evaluate resources periodically or on configuration changes but do not provide instantaneous alerts. Option C is wrong because CloudWatch Logs Insights is a query tool for analyzing historical log data, not a real-time alerting mechanism; it cannot proactively detect changes as they occur. Option D is wrong because Amazon GuardDuty is a threat detection service that focuses on malicious activity and anomalies (e.g., unusual API calls or compromised credentials), not specifically on monitoring CloudTrail configuration changes for compliance or operational awareness.

811
MCQmedium

A DevOps team uses AWS CodePipeline to deploy a static website to an Amazon S3 bucket. The pipeline has a source stage (CodeCommit), a build stage (CodeBuild that runs a build tool), and a deploy stage (S3). After a recent code change, the build stage succeeded but the deploy stage failed with the error: 'Access Denied' when uploading artifacts to the S3 bucket. What should the team do to fix the issue?

A.Configure the S3 bucket to allow public access
B.Add 's3:PutObject' permission to the CodePipeline service role
C.Add an S3 bucket policy that grants the CodeBuild service role s3:PutObject access
D.Verify that the CodeCommit repository has the correct permissions for the pipeline
AnswerB

The deploy stage of CodePipeline assumes the CodePipeline service role when it interacts with S3, so that role must have an IAM policy allowing s3:PutObject on the target bucket. This permission enables the pipeline to upload the artifact archive and any extracted files to the bucket that hosts the static website. Without it, the deploy action fails with a permissions error even if other roles, such as CodeBuild's, happen to have access to the same bucket.

Why this answer

The deploy stage in CodePipeline uses the CodePipeline service role to upload artifacts to the S3 bucket. The error 'Access Denied' indicates that this role lacks the necessary permissions. Adding 's3:PutObject' to the CodePipeline service role grants it the required write access to the S3 bucket, resolving the issue.

Exam trap

The trap here is confusing the CodeBuild service role with the CodePipeline service role; candidates often mistakenly add permissions to the CodeBuild role instead of the pipeline role, which does not resolve the deploy-stage access denied error.

How to eliminate wrong answers

Option A is wrong because making the S3 bucket publicly accessible would expose the static website to unauthorized write operations and is a security risk; it does not address the pipeline's permission issue. Option C is wrong because the CodeBuild service role is used during the build stage, not the deploy stage; the deploy stage uses the CodePipeline service role to upload artifacts to S3. Option D is wrong because the error occurs during the deploy stage, not the source stage; CodeCommit permissions are irrelevant to the S3 upload failure.

812
MCQeasy

Which AWS service is primarily used to automate the building, testing, and deployment of code changes to AWS infrastructure based on a defined release process?

A.AWS CodeCommit
B.AWS CodePipeline
C.AWS CodeBuild
D.AWS CodeDeploy
AnswerB

AWS CodePipeline is a fully managed continuous delivery service that automates the entire release process, from source through build, test, and deployment. It orchestrates the pipeline by connecting multiple stages, such as pulling code from CodeCommit, invoking CodeBuild, and triggering CodeDeploy, along with integrations for third-party tools like Jenkins or GitHub. This end-to-end automation makes it the central CI/CD service in AWS.

Why this answer

AWS CodePipeline is the correct service because it is a fully managed continuous delivery service that orchestrates the building, testing, and deployment of code changes through a defined release process. It integrates with source control (e.g., CodeCommit, GitHub), build services (e.g., CodeBuild), and deployment services (e.g., CodeDeploy) to automate the entire pipeline from commit to production.

Exam trap

The trap here is that candidates often confuse the individual services (CodeBuild for building, CodeDeploy for deploying) with the orchestrator (CodePipeline) that ties them together, leading them to select a service that performs only one part of the process rather than the full automation of the release process.

Why the other options are wrong

A

CodeCommit is a source control service, not a CI/CD pipeline orchestrator.

C

CodeBuild is a build service that compiles source code and runs tests, but it does not orchestrate the entire release process.

D

CodeDeploy automates code deployment to compute services, but it is not a full pipeline orchestrator.

813
MCQmedium

A DevOps engineer is using AWS Systems Manager Parameter Store to manage configuration data for a fleet of Amazon EC2 instances. The engineer needs to store a database password that must be encrypted at rest and audited for access. The password should be automatically rotated every 30 days. Which solution meets these requirements?

A.Store the password as a String parameter in Parameter Store and enable AWS CloudTrail logging.
B.Store the password as a SecureString parameter in Parameter Store with the default AWS managed KMS key.
C.Store the password in AWS Secrets Manager and configure automatic rotation using a Lambda rotation function.
D.Store the password in an encrypted Amazon S3 object and use S3 bucket policies to restrict access.
AnswerC

AWS Secrets Manager is designed for storing and rotating secrets. It supports automatic rotation via Lambda functions, and it integrates with AWS KMS for encryption and AWS CloudTrail for auditing. This solution meets all requirements: encryption at rest, auditing, and automatic 30-day rotation.

Why this answer

AWS Secrets Manager is purpose-built for managing secrets like database passwords. It encrypts secrets using KMS, logs access via CloudTrail, and supports automatic rotation through Lambda functions. Parameter Store SecureString parameters offer encryption but lack built-in rotation.

Therefore, Secrets Manager is the correct choice for meeting all requirements.

Exam trap

The trap here is assuming that Parameter Store SecureString parameters support automatic rotation, which they do not; rotation must be implemented manually.

814
MCQhard

A DevOps engineer is using AWS CodePipeline to deploy a containerized application to Amazon ECS. The pipeline has a source stage (Amazon ECR), a build stage (AWS CodeBuild), and a deploy stage (Amazon ECS). The engineer wants to implement blue/green deployments with automatic rollback if the new version fails health checks. Which configuration should the engineer use to achieve this?

A.Configure the ECS deploy action to use the 'CODE_DEPLOY' deployment controller and specify a CodeDeploy application and deployment group with blue/green configuration.
B.Configure the build stage to create a new ECS task definition and update the service with a new target group, and use AWS Lambda to shift traffic and roll back on failure.
C.Use the 'ECS' deployment controller and configure the ECS service to use a rolling update deployment type with a minimum healthy percent of 100.
D.Add a manual approval action before the deploy stage and configure the ECS service to use the 'EXTERNAL' deployment controller.
AnswerA

AWS CodePipeline integrates with AWS CodeDeploy to provide blue/green deployments for ECS. By setting the ECS deploy action to use the 'CODE_DEPLOY' deployment controller, you can specify a CodeDeploy application and deployment group configured for blue/green. CodeDeploy manages the traffic shift and can automatically roll back if health checks fail. This is the standard way to achieve blue/green with automatic rollback in CodePipeline.

Why this answer

To implement blue/green deployments for ECS with automatic rollback, the engineer should use AWS CodeDeploy as the deployment controller. In CodePipeline, the ECS deploy action can be configured to use CodeDeploy, specifying a CodeDeploy application and deployment group set up for blue/green. CodeDeploy handles the creation of a new task set, traffic shifting, and automatic rollback based on health checks.

This is the native AWS solution, providing reliability and minimal operational overhead. The other options either use rolling updates, require custom automation, or do not provide blue/green capabilities.

Exam trap

The trap here is assuming that ECS rolling updates or custom Lambda-based traffic shifting can provide blue/green with automatic rollback, when the managed solution requires CodeDeploy with the CODE_DEPLOY controller.

815
MCQeasy

A team wants to automate the deployment of a serverless application using AWS SAM. They have a template.yaml file defining Lambda functions, an API Gateway, and a DynamoDB table. Which command should they use to build and deploy the application?

A.aws cloudformation deploy --template-file template.yaml
B.sam package --output-template-file packaged.yaml
C.sam build && sam deploy
D.sam deploy --guided
AnswerC

This is the correct non-interactive deployment sequence for an AWS SAM application in an automated pipeline. `sam build` prepares the application by installing dependencies, compiling code, and creating the deployment artifacts required for Lambda functions and layers. `sam deploy` then packages these artifacts, uploads them to S3, and uses AWS CloudFormation to create or update the stack, all without requiring manual intervention.

Why this answer

The correct command sequence is `sam build && sam deploy` because AWS SAM requires the `sam build` command to transform the SAM template into an AWS CloudFormation template with the necessary artifact packaging, and then `sam deploy` to create or update the stack. Option C is the only choice that performs both the build (which resolves local dependencies and prepares deployment artifacts) and the deployment step, which is essential for a serverless application defined in a SAM template.

Exam trap

The trap here is that candidates often confuse `sam deploy` with `aws cloudformation deploy` or assume `sam deploy --guided` can handle the entire workflow without a separate build step, not realizing that `sam build` is mandatory to transform SAM-specific resources into standard CloudFormation resources and to prepare deployment artifacts.

How to eliminate wrong answers

Option A is wrong because `aws cloudformation deploy --template-file template.yaml` directly uses the raw SAM template, which AWS CloudFormation cannot process without first being transformed by `sam build` or `sam package`; it would fail due to unsupported SAM-specific resources like `AWS::Serverless::Function`. Option B is wrong because `sam package` only uploads artifacts to S3 and generates a packaged template, but it does not deploy the stack; it must be followed by a deploy command. Option D is wrong because `sam deploy --guided` is an interactive mode that prompts for parameters and configuration but still requires the template to be built first (i.e., `sam build` must run before `sam deploy --guided`); running it alone without a prior build will fail.

816
MCQhard

A DevOps engineer runs the above AWS CLI commands and notices that the CodeBuild project 'my-project' exists but builds fail with the error 'Access Denied' when trying to fetch source code from CodeCommit. The IAM role 'CodeBuildServiceRole' has a policy that allows 'codecommit:GitPull' on all repositories. What is the most likely cause of the failure?

A.The IAM role does not have permissions to access the CodeCommit repository.
B.The IAM role does not have a trust policy that allows CodeBuild to assume the role.
C.The CodeCommit repository does not exist.
D.The source location in the build project is incorrect.
AnswerB

CodeBuild first calls sts:AssumeRole to obtain temporary credentials for the service role, and this requires the role's trust policy to include codebuild.amazonaws.com as a trusted service principal. The permissions policy may be correct, but if the trust policy is missing or misconfigured, CodeBuild is not authorized to assume the role and the build fails before any repository action occurs. This is the classic cause when CLI output verifies the repository and the permissions policy, yet the build cannot start.

Why this answer

The error 'Access Denied' when CodeBuild tries to fetch source code from CodeCommit typically indicates that the IAM role CodeBuild is using does not have the necessary permissions to perform the action. Even though the role 'CodeBuildServiceRole' has a policy allowing 'codecommit:GitPull', the role itself must have a trust policy that allows the CodeBuild service to assume it. Without a proper trust policy, CodeBuild cannot assume the role, and any attached permissions are irrelevant, leading to an access denied error.

Exam trap

The trap here is that candidates often focus on the IAM policy permissions (e.g., 'codecommit:GitPull') and overlook the necessity of a trust policy, assuming that if the policy allows the action, the role is automatically usable by the service.

How to eliminate wrong answers

Option A is wrong because the IAM role does have a policy that allows 'codecommit:GitPull' on all repositories, so the permissions are present; the issue is that the role cannot be assumed. Option C is wrong because the problem states the CodeBuild project 'my-project' exists and the error occurs when fetching source code, implying the repository exists; if it didn't, the error would be 'RepositoryNotFound' or similar. Option D is wrong because an incorrect source location would typically result in a 'RepositoryNotFound' or 'InvalidSourceLocation' error, not an 'Access Denied' error.

817
MCQhard

A company uses a centralized AWS KMS customer master key (CMK) in the security account to encrypt data in S3 buckets across multiple accounts. The S3 buckets are accessed by EC2 instances in the same accounts. The security team wants to ensure that the CMK can only be used by authorized IAM roles in the member accounts. Which policy configuration should be used?

A.Attach an IAM policy to the IAM roles in the member accounts that allows kms:Decrypt on the CMK.
B.Add a statement to the KMS key policy that grants the IAM roles in the member accounts permission to use the key.
C.Create a service control policy (SCP) that allows kms:Decrypt for the CMK.
D.Use a VPC endpoint policy for KMS to allow access from the member accounts' VPCs.
AnswerB

In AWS KMS, a customer master key is always governed by a resource-based key policy in the account that owns the key. To allow principals in separate member accounts to use the CMK, the key policy must include a statement whose Principal element contains the ARN of the IAM role (or the member account root) and grants the required cryptographic actions, such as kms:Decrypt. This acts as the cross-account authorization; additionally, the member account's IAM policy must delegate those same actions to the role, because KMS requires that both the key policy allow the principal and the principal's IAM policy allow the action.

Why this answer

A KMS key policy is the primary resource-based policy that controls who can use a customer managed key, and it must explicitly grant the member-account IAM roles permission to use the key for cross-account access. Because the CMK lives in the security account and the roles live in member accounts, the key policy must include a statement allowing those external principals to call kms:Decrypt and related actions. Without this key policy statement, IAM policies in the member accounts alone cannot grant access to the cross-account key.

Exam trap

DOP-C02 often tests the misconception that an IAM policy in the member account is sufficient for cross-account KMS access, so candidates must remember that the key policy in the owning account must grant permission first and that SCPs only restrict, never grant.

How to eliminate wrong answers

Option A is wrong because an IAM policy attached to a role in a member account cannot by itself grant access to a CMK owned by another account; cross-account KMS access requires the key policy in the owning account to delegate permission to the external principal first. Option C is wrong because an SCP is an AWS Organizations guardrail that sets the maximum available permissions for accounts in an organization; it can only restrict, never grant, kms:Decrypt access to a CMK. Option D is wrong because a VPC endpoint policy controls which requests can traverse a VPC endpoint to KMS, but it does not grant cross-account permission to use a specific CMK and cannot substitute for the key policy.

818
MCQeasy

A company wants to receive a notification when an AWS IAM user creates a new access key. Which AWS service should be used to capture this event and trigger a notification?

A.Amazon GuardDuty
B.AWS CloudTrail with CloudWatch Events
C.Amazon CloudWatch
D.AWS Config
AnswerB

AWS CloudTrail records all API calls made by IAM users as events, and CloudWatch Events (now Amazon EventBridge) can be configured with event patterns to match specific actions. This integration enables real-time notifications by routing matched events to an SNS topic or Lambda function. Thus, CloudTrail provides the audit log while CloudWatch Events performs the filtering and alerting.

Why this answer

AWS CloudTrail captures API activity, including the CreateAccessKey event when an IAM user creates a new access key. By sending these events to Amazon CloudWatch Events (now part of Amazon EventBridge), you can define a rule that triggers a notification via SNS, Lambda, or other targets. This combination provides the real-time event-driven notification the company requires.

Exam trap

The trap here is that candidates often confuse CloudWatch (which handles metrics and logs) with CloudWatch Events (which handles event-driven triggers), leading them to pick Option C, even though CloudWatch alone cannot capture API calls without CloudTrail integration.

How to eliminate wrong answers

Option A is wrong because Amazon GuardDuty is a threat detection service that analyzes VPC Flow Logs, DNS logs, and CloudTrail management events for malicious activity, but it does not directly trigger custom notifications for specific IAM actions like CreateAccessKey. Option C is wrong because Amazon CloudWatch is a monitoring service for metrics, logs, and alarms, but it cannot natively capture API-level events like CreateAccessKey; it relies on CloudTrail or CloudWatch Events to ingest such events. Option D is wrong because AWS Config evaluates resource configurations and compliance rules, but it does not capture real-time API calls or trigger notifications for specific IAM user actions like creating an access key.

819
MCQhard

An EC2 instance is in 'running' state according to the CLI output, but the application hosted on it is unreachable. The DevOps engineer checks the security group and finds it allows inbound HTTP traffic from 0.0.0.0/0. The instance has a public IP. What is the MOST likely issue?

A.The network ACL is blocking inbound HTTP traffic.
B.The instance does not have a public IP address assigned.
C.The security group is attached to the instance but does not allow inbound HTTP.
D.The instance's OS firewall (e.g., iptables) is blocking the traffic.
AnswerD

The instance OS runs its own packet-filtering firewall—typically iptables or firewalld on Linux—which operates independently of AWS's security groups and network ACLs. Even with a permissive security group and a correct public IP, an iptables rule (e.g., default INPUT policy DROP or a REJECT rule) will drop inbound HTTP packets before they reach the web server. This is a classic scenario where all AWS-side checks pass but the instance remains unreachable, hence the CLI 'running state' does not reflect host-level firewall state.

Why this answer

The instance is running, has a public IP, and the security group allows inbound HTTP from 0.0.0.0/0. Since the security group is correctly configured, the most likely cause is a host-level firewall (e.g., iptables, Windows Firewall) blocking the traffic. Security groups operate at the hypervisor level and do not override OS-level firewalls; thus, even with permissive security group rules, the OS can still drop packets.

This is a common misconfiguration when instances are launched with restrictive default OS firewall rules.

Exam trap

DOP-C02 often tests the misconception that security groups are the only firewall layer, leading candidates to overlook OS-level firewalls when security groups are correctly configured.

How to eliminate wrong answers

Option A is wrong because a network ACL blocking inbound HTTP would typically be a less likely cause given that the security group is correctly configured and the instance is reachable at the network level (though not explicitly stated, the scenario implies the security group is the primary suspect; NACLs are stateless and would need explicit deny rules, but the question does not suggest NACL misconfiguration). Option B is wrong because the instance already has a public IP address, as stated in the question. Option C is wrong because the security group is explicitly described as allowing inbound HTTP from 0.0.0.0/0, so it does allow HTTP.

820
Multi-Selecthard

A DevOps engineer is designing a deployment pipeline for a serverless application using AWS SAM. The pipeline must include the following stages: source, build, deploy to a development environment, run integration tests, and promote to production after manual approval. Which AWS services and features should be used to implement this pipeline? (Choose two.)

Select 2 answers
A.AWS CodeDeploy for deploying the SAM application.
B.AWS CodePipeline to orchestrate the pipeline stages.
C.AWS CodeCommit to build the SAM application.
D.AWS CodeBuild to run the SAM build, package, and test commands.
AnswersB, D

AWS CodePipeline is the fully managed continuous delivery service that models the entire release process as sequential stages (source, build, deploy) and manages transitions, artifacts, and approvals. For a SAM application, CodePipeline pulls source from a repository, invokes CodeBuild to run SAM CLI commands, and triggers a CloudFormation deployment through a deploy action. Its stage-based orchestration is exactly what the question's 'pipeline stages' refers to, making it the correct service to orchestrate the pipeline.

Why this answer

AWS CodePipeline is the correct service for orchestrating the pipeline stages because it provides native support for defining source, build, deploy, test, and manual approval stages in a sequential workflow. It integrates directly with AWS SAM and can trigger builds and deployments based on source code changes, making it the ideal orchestrator for this multi-stage pipeline.

Exam trap

The trap here is that candidates often confuse AWS CodeDeploy with the deployment mechanism for SAM applications, not realizing that SAM deployments are actually handled through AWS CloudFormation (via CodeBuild or CodePipeline), not CodeDeploy directly.

Why the other options are wrong

A

SAM applications are deployed via CloudFormation, not CodeDeploy.

C

CodeCommit is a source control service, not a build service.

821
MCQeasy

A development team uses AWS CodeCommit to store source code and AWS CodePipeline to automate builds and deployments. The team wants to ensure that every commit to the main branch triggers a build and deployment to a test environment. Which action should be taken?

A.Create a CodeBuild project that watches the main branch and starts a pipeline.
B.Use AWS Lambda to poll the repository and start the pipeline on new commits.
C.Set up an Amazon CloudWatch Events rule that matches commits to the main branch and targets the CodePipeline.
D.Configure the source stage of the CodePipeline to use the CodeCommit repository and specify the main branch.
AnswerD

In CodePipeline, a source stage with a CodeCommit action automatically subscribes to repository events on the specified branch (e.g., main) and triggers a new pipeline execution whenever a commit is pushed. This is the standard, fully managed integration: CodePipeline creates the necessary event rule to detect the branch update and passes the commit ID and repository name as inputs to subsequent stages. By specifying the branch in the action configuration, you also get filtering on that branch only, making this the simplest and most reliable way to achieve continuous delivery from CodeCommit.

Why this answer

CodePipeline natively integrates with CodeCommit as a source action. By configuring the source stage to use the CodeCommit repository and specifying the main branch, the pipeline automatically triggers on every commit to that branch without any additional infrastructure or polling. This is the simplest and most reliable approach, as CodePipeline uses Amazon CloudWatch Events under the hood to detect changes.

Exam trap

The trap here is that candidates may overthink the solution and choose a more complex option (like Lambda polling or manual CloudWatch Events rules) instead of recognizing that CodePipeline's native source configuration already handles event-driven triggers automatically.

How to eliminate wrong answers

Option A is wrong because CodeBuild does not have a built-in 'watch' feature for branches; it can only be triggered by events or manual invocation, and creating a CodeBuild project to watch a branch would require custom polling logic, which is unnecessary. Option B is wrong because using Lambda to poll the repository is an anti-pattern; it introduces latency, cost, and complexity, whereas CodePipeline already provides event-driven triggers via CloudWatch Events. Option C is wrong because while a CloudWatch Events rule can trigger a pipeline, it is redundant and less direct; CodePipeline automatically creates the necessary CloudWatch Events rule when you configure the source stage with CodeCommit, so manually creating one is unnecessary and can lead to duplicate triggers or misconfiguration.

822
MCQmedium

Refer to the exhibit. A security engineer sees this CloudTrail event. What action did the user 'admin' perform?

A.Encrypted data with a KMS key.
B.Rotated a KMS key.
C.Created a new KMS key.
D.Deleted a KMS key.
AnswerC

The event name "CreateKey" maps directly to the AWS KMS CreateKey API call, which is used to provision a new customer master key (CMK). In the CloudTrail log, the resources array contains the ARN of the newly created key (e.g., arn:aws:kms:region:account:key/key-id), confirming that a new symmetric or asymmetric KMS key was successfully created. This is the only action listed whose event name and resource type align with the observed log entry.

Why this answer

The CloudTrail event shows the API call CreateKey, which is the KMS operation that provisions a brand-new customer managed key. The event name in CloudTrail directly maps to the KMS API action, and CreateKey returns a new key ID with key state 'Enabled' and no key material yet until first use. This is distinct from Encrypt, RotateKey, or ScheduleKeyDeletion, each of which produces a different eventName.

Exam trap

The trap here is that candidates see 'KMS' and 'admin' in a CloudTrail snippet and assume the most common KMS operation (Encrypt) rather than reading the actual eventName field, which is the authoritative indicator of the action performed.

How to eliminate wrong answers

Option A is wrong because encryption with a KMS key generates an Encrypt event (or a GenerateDataKey event), not CreateKey, and the request parameters would include a keyId and plaintext, not key policy/spec fields. Option B is wrong because key rotation produces a RotateKeyOnDemand or EnableKeyRotation event and operates on an existing key ID, not a new one. Option D is wrong because deletion produces a ScheduleKeyDeletion event with a pendingDeletionWindowInDays parameter, and the key would move to Pending Deletion state rather than being created.

823
MCQeasy

A DevOps engineer is troubleshooting an AWS Lambda function that is intermittently timing out. The function is configured with a 3-second timeout and 128 MB memory. The function processes messages from an SQS queue. What is the most cost-effective change to reduce timeouts?

A.Increase the SQS batch size to 20
B.Increase the function timeout to 10 seconds
C.Increase the function memory to 256 MB
D.Set reserved concurrency to 10
AnswerC

Lambda allocates CPU proportionally to the configured memory, so increasing memory to 256 MB from a lower value (e.g., 128 MB) roughly doubles the available vCPU fraction, speeding up CPU-bound tasks. This directly targets the performance bottleneck and is a standard first step in Lambda performance tuning. For the stated issue, this change is more likely to reduce execution time than the other options.

Why this answer

Increasing the memory to 256 MB is the most cost-effective change because Lambda allocates CPU proportionally to memory, so doubling the memory from 128 MB to 256 MB also doubles the CPU performance. This reduces execution time, which can resolve timeouts without increasing the timeout duration, and since Lambda billing is based on compute time (GB-seconds), the total cost may stay the same or even decrease if the function finishes faster.

Exam trap

The trap here is that candidates assume increasing the timeout is the only way to fix timeouts, but AWS explicitly recommends increasing memory as a cost-effective performance tuning method because it also increases CPU, which can reduce execution time and thus avoid timeouts without increasing cost.

How to eliminate wrong answers

Option A is wrong because increasing the SQS batch size to 20 would cause the Lambda function to process more messages per invocation, increasing the workload and likely worsening timeouts rather than fixing them. Option B is wrong because increasing the function timeout to 10 seconds does not address the root cause of slow execution; it only masks the symptom and could increase costs if the function still runs longer. Option D is wrong because setting reserved concurrency to 10 limits the number of concurrent executions but does not improve the performance of a single invocation, so it would not reduce timeouts.

824
MCQmedium

A company uses AWS Systems Manager to manage a fleet of EC2 instances. During an incident, a DevOps engineer needs to execute a script on a specific instance to collect diagnostic data. The engineer does not have SSH key access. Which approach should the engineer use to execute the script?

A.Use AWS Systems Manager Run Command to execute the script.
B.Use AWS OpsWorks to run the script as a Chef recipe.
C.Use EC2 Instance Connect to SSH into the instance and run the script.
D.Use AWS Systems Manager Session Manager to open a shell and run the script.
AnswerA

AWS Systems Manager Run Command is the correct choice because it uses the SSM Agent already installed on the EC2 instance to execute a script as a one-shot, non-interactive command. It does not require SSH, opening port 22, or managing SSH keys, and it works across multiple instances concurrently with rate control and output logging. Run Command is purpose-built for exactly this ad-hoc script execution scenario, and it leverages the instance's IAM role for permissions, avoiding any need for bastion hosts or direct network access.

Why this answer

AWS Systems Manager Run Command is the correct tool because it lets you execute scripts or commands on managed EC2 instances remotely without SSH, RDP, or any inbound ports open. The instance only needs the SSM Agent and an IAM instance profile with the right permissions, which satisfies the 'no SSH key access' constraint.

Exam trap

DOP-C02 often tests the difference between Run Command (non-interactive script execution) and Session Manager (interactive shell) — candidates pick Session Manager because it also avoids SSH, but the question asks for script execution, not a shell.

How to eliminate wrong answers

Option B is wrong because AWS OpsWorks is a configuration management service (Chef/Puppet) for lifecycle management, not an ad-hoc script execution tool, and it is not the right fit for a one-off diagnostic script during an incident. Option C is wrong because EC2 Instance Connect still relies on SSH (it pushes a temporary key), and the engineer has no SSH key access — plus it requires the instance to be reachable on port 22. Option D is wrong because Session Manager opens an interactive shell session, which is not the same as executing a script non-interactively and would require the engineer to manually type or paste commands, adding friction and audit gaps.

825
MCQeasy

A company is using AWS CloudFormation to manage infrastructure. The DevOps team wants to receive notifications when CloudFormation stack creation fails. Which AWS service should be used to capture the stack failure event and send a notification?

A.Amazon SQS
B.Amazon CloudWatch Logs
C.AWS CloudTrail
D.Amazon EventBridge
AnswerD

Amazon EventBridge is the correct service because it is a serverless event bus that natively captures AWS service events, including CloudFormation stack lifecycle changes (CREATE, UPDATE, DELETE), and delivers them to targets like SNS, Lambda, or SQS for immediate action. EventBridge rules filter on resource type, event detail type, and other JSON fields, allowing you to build precise event-driven workflows without custom polling. This makes it the standard, low-latency solution for reacting to CloudFormation events in real time.

Why this answer

Amazon EventBridge can capture CloudFormation stack events (such as CREATE_FAILED) using event rules and route them to targets like Amazon SNS for notifications. Option A is wrong because Amazon SQS is a message queue service and does not directly send notifications; it requires a consumer. Option B is wrong because Amazon CloudWatch Logs stores log data but does not capture CloudFormation events or send notifications.

Option C is wrong because AWS CloudTrail records API calls but is not designed for real-time event-driven notifications; it is better suited for auditing.

Page 10

Page 11 of 18

Page 12