Courseiva
SDLC Automation →mediumMultiple Choice

DOP-C02 CodeBuild DOWNLOAD_SOURCE phase Practice Question

Network Topology
$ aws codebuild batch-get-buildsids "build-project:example-build-id"Refer to the exhibit.```"builds": ["id": "build-project:example-build-id","buildStatus": "FAILED","phases": ["phase-type": "SUBMITTED","phase-status": "SUCCEEDED","start-time": "2023-01-01T00:00:00","end-time": "2023-01-01T00:00:05"},"phase-type": "QUEUED","start-time": "2023-01-01T00:00:05","end-time": "2023-01-01T00:00:10""phase-type": "PROVISIONING","start-time": "2023-01-01T00:00:10","end-time": "2023-01-01T00:00:20""phase-type": "DOWNLOAD_SOURCE","phase-status": "FAILED","start-time": "2023-01-01T00:00:20","end-time": "2023-01-01T00:01:30"],"source": {"type": "S3","location": "my-bucket/source.zip"

The exhibit shows the output of the AWS CLI command 'batch-get-builds' for a CodeBuild build. The build failed. What is the most likely cause of the failure?

⚠ Common exam trap

Watch out — candidates often assume a build failure is always due to code errors or buildspec issues, but the error message in the CLI output directly points to an S3 permission problem during the DOWNLOAD_SOURCE phase. Unlike artifact uploads which require s3:PutObject, source downloads require s3:GetObject, and candidates must distinguish between the two.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The S3 bucket 'my-bucket' does not exist or the build project lacks permissions to access it.

The `batch-get-builds` output shows a failure in the DOWNLOAD_SOURCE phase, with an error indicating that the build could not access the S3 bucket `my-bucket`. The error details, such as 'Access Denied' or 'NoSuchBucket', imply that the CodeBuild service role lacks the required `s3:GetObject` permission on the bucket, or the bucket does not exist. This is a common misconfiguration when the source code is stored in an S3 bucket and the build project is not properly configured to retrieve it.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The source code has compilation errors.

    Why it's wrong here

    Compilation errors surface as messages from the compiler within the build log's build phase, not as the phase status shown. The exhibit indicates the failure occurred at a different stage, so the cause lies elsewhere in the build lifecycle. It would be tempting when the log explicitly shows compiler diagnostics such as syntax errors.

  • ✗

    The buildspec file is malformed.

    Why it's wrong here

    A malformed buildspec produces a specific validation error in the build's phases and typically fails before any commands run, which the exhibit does not show. The failure arises during command execution, pointing to the build commands themselves. It would be tempting when the log shows a YAML parse error at buildspec download.

  • ✗

    The build project does not have sufficient memory.

    Why it's wrong here

    Build failures from insufficient memory surface as an out-of-memory kill during the build phase, not as the phase-level status shown in batch-get-builds output. Memory is a compute resource configured on the project; it would be the cause only if logs showed the container being terminated mid-build.

  • ✓

    The S3 bucket 'my-bucket' does not exist or the build project lacks permissions to access it.

    Why this is correct

    CodeBuild reports a client error when it cannot retrieve source artefacts, and the build log shows an S3 access failure. Either the bucket 'my-bucket' is absent or the service role lacks s3:GetObject permission, so the build fails before compilation begins.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 1,298 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.