Community Q&A

DOP-C02 — frequently asked questions

Community-vetted answers to 48 common questions about this exam, each traced back to a specific practice question.

Questions from real practice questions

Each Q&A comes from a specific question — follow the link for the full analysis

Optimizing Amazon Timestream Query Performance

Why is E not the best choice for fastest query performance?

E affects retention, not query logic. It keeps recent data in memory but doesn't reduce the I/O cost of reading/write structure like A and D do.

Does multi-measure record slow down queries if I only need one metric?

No. Timestream can push down filters to specific measures within a multi-measure record, scanning only the relevant data rather than the whole record.

Refactor user data to cfn-init with cfn-hup, and enforce the SSM document with a State Manager association

Why doesn't CloudFormation update EC2 apps after stack change?

User data runs only at boot. Stack updates do not re-execute user data on existing instances, leaving them unchanged.

How does cfn-hup fix this in option B?

cfn-hup monitors metadata for changes and triggers cfn-init to apply updates without replacing instances.

What is the role of SSM State Manager in option E?

It continuously enforces an SSM document association, ensuring running instances converge to the desired application state.

Create an IAM OIDC identity provider, a role trusting the IdP audience, and use AssumeRoleWithWebIdentity

Why is AssumeRoleWithWebIdentity needed for this OIDC web application?

The app must exchange its OIDC token for temporary AWS credentials to call Amazon S3, which is exactly what AssumeRoleWithWebIdentity does. This avoids long-term access keys and matches option E.

Which trust policy condition key should the IAM role use for auth.company.com?

Use auth.company.com:aud with StringEquals, matching option D. Option C's sts.amazon.com:aud is not the documented condition key for a custom OIDC provider.

What three steps combine to secure S3 access with an OIDC-only IdP?

Create an IAM OIDC provider using the provider URL, audience, and signature (B); create an IAM role with S3 permissions and the OIDC trust policy (D); then call AssumeRoleWithWebIdentity (E).

Activate the Control Tower RDS encryption guardrail and notify through EventBridge to SNS

Does AWS Control Tower use AWS Config?

Yes, Control Tower guardrails are built on AWS Config rules. Activating a guardrail leverages this underlying capability without custom deployment.

Why is Option C less efficient than A?

Option C requires creating and deploying custom Config rules to every account. Option A uses pre-built Control Tower guardrails, reducing management overhead.

Use IAM Roles Anywhere for the on-premises pipeline and CodeArtifact external connections for public repositories

How does IAM Roles Anywhere reduce overhead for on-premises pipelines?

It allows the pipeline to assume an IAM role without managing long-term credentials or EC2 instances, providing direct access to CodeArtifact.

Why must external connections be configured as upstream repositories?

Upstream configuration ensures CodeArtifact pulls dependencies from public sources into your private repository during builds, rather than pushing outwards.

Deploy Lambda with a canary configuration and automatic rollback triggered by API Gateway 5XX alarms

Why does LambdaAllAtOnce fail the fewest customers requirement?

It deploys to 100% of traffic immediately, exposing all users to errors before any rollback can occur.

Can CloudWatch metric filters trigger Lambda functions for rollbacks?

No, metric filters cannot invoke Lambda. Use alarms or events instead for automated actions.

What is the difference between automatic and manual rollbacks in CodeDeploy?

Automatic rollbacks trigger immediately based on alarm thresholds without human intervention, improving efficiency.

Pre-stage CloudFormation templates in S3 and rely on cross-Region replication for images and Aurora backups

Why does rebuilding Docker images fail the RTO?

The question states builds can exceed 2 hours. Pre-replicating images via ECR avoids this delay during recovery.

Does Aurora support native cross-region backups?

No, automated backups are region-local. Use Global Database or snapshot copying to meet RPO requirements across regions.

Query the log group with CloudWatch Logs Insights to count logins over seven days

Why can't I use a CloudWatch metric filter for past logs?

Metric filters only process log events ingested after their creation. They cannot retroactively analyze logs from the previous 7 days.

What is CloudWatch Logs Insights used for?

It allows ad-hoc querying and aggregation of stored log data using SQL-like syntax, perfect for analyzing historical trends without pre-setup.

Split the deployment group into an Environment tag group and a Name tag group to require both tags

How does CodeDeploy evaluate multiple tag groups?

Tags within a single group use OR logic, while separate groups use AND logic. An instance must match at least one tag in every defined group.

Why does option B fail to exclude the new instance?

Option B puts all tags in one group, applying OR logic. The new instance matches Environment=Production, so it still gets selected despite other mismatches.

What is the key rule for CodeDeploy tag selection?

Use separate single-tag groups to enforce AND conditions. Keep related tags in one group only if you want OR behavior between them.

Give each application an S3 Object Lambda access point that redacts data as objects are retrieved

Why is S3 Object Lambda better than replicating buckets?

Replication copies raw data without modification, failing the redaction requirement. Object Lambda transforms data on read, keeping a single source of truth.

Can one S3 bucket serve multiple redacted views?

Yes. By creating separate S3 Object Lambda access points for each application, you can apply distinct Lambda functions to redact data differently for each consumer.

Enable the proactive Control Tower S3 KMS-encryption control with CloudFormation hooks on all OUs

Why does SCP option A fail to encrypt S3 buckets?

SCP A denies PutObject, which secures object uploads, not the bucket creation itself. It cannot prevent an unencrypted bucket from being provisioned.

What is the difference between proactive and detective controls here?

Proactive controls block non-compliant stack operations before resources are created. Detective controls only report violations after the resource exists.

Enable the AWS Config drift-detection managed rule and alert on its compliance-change event via EventBridge

Why is AWS Config better than Lambda for drift detection?

AWS Config emits real-time compliance events to EventBridge, whereas Lambda requires periodic polling which introduces latency.

Can GuardDuty detect CloudFormation configuration drift?

No, GuardDuty focuses on threat detection like malware or unauthorized access, not infrastructure configuration compliance.

Reduce Latency for Lambda Processing Kinesis Logs

Why is Enhanced Fan-Out better than default polling?

Enhanced Fan-Out provides dedicated throughput per consumer, removing contention and reducing latency caused by shared bandwidth and polling intervals.

Does Reserved Concurrency help with latency?

No, Reserved Concurrency limits maximum concurrent executions. It protects against throttling but does not increase processing speed or reduce backlog latency.

AWS S3 Cross-Region Replication for Multi-Region HA

Why is unidirectional CRR insufficient?

Unidirectional CRR only replicates Primary to Secondary. If the app fails over to Secondary and writes data, that data is not sent back to Primary, causing loss upon return.

Is 'two-way replication rule' a real AWS feature?

Yes, Managed Replication (MRP) supports two-way rules. It automates the creation of replication rules between buckets to keep them in sync bidirectionally.

CodeDeploy AppSpec File Mapping Rules

Does CodeDeploy stop processing file mappings after the first match?

No, CodeDeploy processes all defined file mappings in the appspec.yml. If a file matches multiple rules, it will be deployed to all specified destinations.

How does the root directory mapping affect specific files?

Mapping the root directory '/' to a destination copies all files and folders from the source root to that destination, including any specific files already targeted by other rules.

EKS Cluster Metrics and Log Collection with CloudWatch

Why is Option A wrong if it works?

Option A uses the legacy CloudWatch Agent and Fluent Bit. AWS now recommends AWS Distro for OpenTelemetry (ADOT) for EKS as it provides a unified, standardized way to collect metrics and logs.

How do you monitor the Autoscaler in Option E?

You use a CloudWatch Metric Log Filter Alarm. This type of alarm monitors log groups for specific patterns (like error messages) in the Autoscaler's deployment logs.

ECR Pull Through Cache and VPC Endpoints for ECS

Can I use a VPC Endpoint for Amazon ECR Public repositories?

No, VPC endpoints do not support ECR Public repositories. You must use a pull-through cache rule to cache public images in a private repository.

Why is Option A not the best choice for caching public images?

Option A requires managing a separate CodeBuild project for each image, creating high operational overhead. The pull-through cache rule automates this efficiently.

Route 53 Zonal Shift with ALB Target Group Settings

Can I disable cross-zone load balancing on an ALB directly?

No, cross-zone load balancing is always enabled for ALBs. You must disable it at the Target Group level.

Why does ARC need cross-zone load balancing disabled?

It ensures traffic stays in the healthy zone during a shift, preventing the ALB from sending requests to unhealthy instances in other zones.

Troubleshooting ECS ALB Health Check Failures

Why not increase minimum healthy percent?

Increasing minimum healthy percent controls the count of running tasks but doesn't stop the ALB from marking an unready task as unhealthy, which still triggers restarts.

Does this apply to EC2 Auto Scaling too?

Yes, the concept is identical; instances also need a grace period to initialize applications before ELB health checks can successfully verify them.

Granting EC2 Access to CodeArtifact for Python Packages

Does CodeArtifact support resource-based policies?

No. CodeArtifact access is controlled entirely through IAM identity-based policies attached to users, roles, or instance profiles.

What is the purpose of aws codeartifact login?

It configures your package manager (like pip) to use temporary credentials from the instance's IAM role to authenticate with CodeArtifact.

Deploying CDK Security Controls Across AWS Accounts

Why isn't CloudFormation StackSets the best choice here?

StackSets require manual or custom automation to manage deployments and drift correction, increasing operational overhead compared to Control Tower's native automation.

How does CDK integrate with AWS Control Tower?

You synthesize your CDK app into a CloudFormation template and use it in Control Tower's Customizations feature to apply configurations to accounts automatically.

Least Overhead for Custom EC2 Metrics

Why is CloudWatch Logs Insights not the best choice?

Logs Insights parses text logs, which is inefficient for structured metrics and requires managing log schemas and queries, increasing operational overhead.

Does the CloudWatch Agent add significant overhead?

No, it is a lightweight daemon installed once on the instance that handles metric aggregation and transmission, reducing application-side coding effort.