Question 160

A VPC-connected CodeBuild job in private subnets must download dependencies from public registries. No proxy exists. What network design provides access?

  1. A public ALB in front of CodeBuild
  2. A route directly to an internet gateway only
  3. Private routes through a NAT gateway with appropriate security rules
  4. A larger build compute size

Explanation

Correct Answer

C:

Build interfaces do not receive public IP addresses; NAT provides outbound internet connectivity from private addresses.

Incorrect Answers

A:

Load balancers handle inbound application requests, not arbitrary outbound dependency downloads.

B:

An internet-gateway route does not supply public addresses to CodeBuild's private interfaces.

D:

Additional CPU and memory do not create an internet route.

Question 161

A role trust policy permits a caller, but the assumed role cannot write the required bucket. What should be checked?

  1. Change only the session name
  2. Create another identity provider without modifying permissions
  3. Expand trust to every AWS account
  4. The role session's effective permissions and applicable resource controls

Explanation

Correct Answer

D:

Trust authorizes role assumption; it does not automatically grant the session access to target resources.

Incorrect Answers

A:

Session naming is not a substitute for an allow on the operation.

B:

Federation setup does not itself authorize bucket writes.

C:

More potential callers do not grant the missing bucket action.

Question 162

A Dockerfile copies a secret and deletes it in a later layer. Why is this unsafe?

  1. Only the final directory listing matters
  2. The image digest encrypts every file
  3. Earlier layers can still contain the secret
  4. Deleting a file always removes all earlier layers

Explanation

Correct Answer

C:

Layered image history can preserve deleted content; use supported secret injection rather than baking credentials into layers.

Incorrect Answers

A:

An empty visible path does not prove the underlying image history lacks the secret.

B:

A content digest identifies data; it is not an encryption mechanism.

D:

Later filesystem changes do not rewrite already-created layer contents.

Question 163

A service should alert when three of five recent periods breach, tolerating isolated spikes. What configuration fits?

  1. Set five evaluation periods and five datapoints to alarm
  2. Five evaluation periods and three datapoints to alarm
  3. Set one evaluation period and one datapoint to alarm
  4. Set three evaluation periods and three datapoints to alarm

Explanation

Correct Answer

B:

M-of-N evaluation requires enough breaches within the window without demanding all periods breach.

Incorrect Answers

A:

That requires all five periods to breach, rather than the specified three within the window.

C:

A single spike would satisfy the condition, violating the requested tolerance.

D:

That requires three breaches within a shorter three-period window, not any three of five.

Question 164

A production stack should resist an accidental DeleteStack request while allowing approved updates. Which control fits?

  1. Remove all stack outputs
  2. Set every resource's UpdateReplacePolicy to Delete
  3. Enable stack termination protection
  4. Use a longer stack name

Explanation

Correct Answer

C:

The control protects stack deletion; resource-level update restrictions require separate mechanisms.

Incorrect Answers

A:

Outputs do not authorize or prevent stack deletion.

B:

That controls replacement cleanup and does not block DeleteStack.

D:

Names provide identification rather than deletion protection.

Question 165

A CloudFront distribution needs an ACM certificate for its custom hostname. In which Region should the certificate be requested?

  1. Only the origin EC2 instance's Region
  2. The Region with the lowest current spot price
  3. US East (N. Virginia), us-east-1
  4. Any Region chosen by the billing owner

Explanation

Correct Answer

C:

CloudFront's ACM integration requires the viewer certificate in that Region, even when origins are elsewhere.

Incorrect Answers

A:

Origin placement does not determine the required viewer-certificate Region.

B:

Compute pricing has no bearing on certificate attachment rules.

D:

Billing ownership does not remove the integration requirement.

Question 166

Interruptible workers can tolerate retries but need resilient low-cost capacity. Which fleet strategy fits?

  1. Use one Spot instance type in one Availability Zone
  2. Diversify Spot instance types and AZs with appropriate capacity allocation
  3. Assume Spot instances provide an uninterrupted capacity guarantee
  4. Keep task progress exclusively in volatile instance memory

Explanation

Correct Answer

B:

Multiple capacity pools reduce dependence on one scarce pool, while interruption handling preserves work.

Incorrect Answers

A:

A single capacity pool exposes all workers to the same shortage or interruption conditions.

C:

Interruption-tolerant operation still requires retries and diversified capacity planning.

D:

An interruption can erase uncheckpointed work and undermine reliable retry or recovery.

Question 167

A repository requires at least 85% branch coverage. Reports currently show 72%, but releases continue. How should enforcement be added?

  1. Rename the report to required.xml
  2. Run a coverage threshold check that exits nonzero below 85%
  3. Set deployment traffic to 85%
  4. Increase the report group's retention

Explanation

Correct Answer

B:

Publishing coverage is observational; an explicit failing command makes the quality gate actionable.

Incorrect Answers

A:

A file name alone cannot implement a numeric coverage policy.

C:

Traffic routing percentages do not measure exercised source branches.

D:

Historical visibility does not enforce a minimum percentage.

Question 168

ECS task capacity is insufficient under load, but the EC2 cluster also has no free resources. What must scaling address?

  1. Raise service desired task count only
  2. Scale EC2 instances but keep the service task count fixed despite excess load
  3. Increase the ALB idle timeout as the capacity mechanism
  4. Both service task demand and underlying cluster capacity

Explanation

Correct Answer

D:

More desired tasks cannot run if the placement layer lacks CPU, memory, or suitable instances.

Incorrect Answers

A:

Additional desired tasks remain pending when the EC2 placement layer lacks resources.

B:

Free hosts do not themselves increase the number of application tasks serving requests.

C:

Connection timing does not create application tasks or host resources.

Question 169

A build may upload artifacts only under releases/app-a/ in one bucket. Which policy scope fits?

  1. Grant only ListAllMyBuckets
  2. Allow PutObject only on the bucket ARN without an object suffix
  3. Allow s3:* on all resources
  4. Limit object-write actions to that bucket's releases/app-a/* object ARN

Explanation

Correct Answer

D:

Object permissions use object ARNs; add only separately justified bucket-level permissions for required operations.

Incorrect Answers

A:

Account bucket listing does not authorize artifact uploads.

B:

Object actions require the applicable object resource scope.

C:

That exceeds both the specified operation and prefix scope.

Question 170

A team wants CloudFormation provisioning to use a controlled identity instead of each operator's broad permissions. What should it configure?

  1. A public S3 object ACL
  2. An application EC2 key pair
  3. A least-privilege CloudFormation service role
  4. A repository branch tag

Explanation

Correct Answer

C:

The service assumes this role for stack operations; control who may pass it and operate stacks that use it.

Incorrect Answers

A:

Public artifact access cannot scope stack execution privileges.

B:

SSH keys authorize host login, not CloudFormation resource provisioning.

D:

Version-control metadata does not establish an AWS service identity.

AWS Certified DevOps Engineer - Professional DOP-C02 Practice Tests