The answer is that the `discard-paths` option is set to `yes`, which flattens the directory structure. In AWS CodeBuild, when `discard-paths: yes` is specified in the buildspec.yml artifacts section, all files are placed directly into the root of the output artifact, stripping away any folder hierarchy. This is the default behavior for many artifact types unless explicitly overridden, so to preserve the directory structure you must set `discard-paths: no`. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this concept tests your understanding of how CodeBuild handles artifact output, often appearing as a subtle trap where candidates overlook the `discard-paths` default. A common memory tip is to think of "discard" as "throw away the folders"—if you want to keep folder structure, you must say "no" to discarding.
DOP-C02 SDLC Automation Practice Question
This DOP-C02 practice question tests your understanding of sdlc automation. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- '**/*'
discard-paths: yes
Refer to the exhibit. A team uses this buildspec.yml file in AWS CodeBuild. After the build, they expect the artifacts to be placed in a folder structure, but all files are in the root of the output artifact. What is the reason?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The 'discard-paths' option is set to 'yes', which flattens the directory structure.
Option A is correct because 'discard-paths: yes' flattens the structure. Option B is wrong because it only shows files. Option C is wrong because 'base-directory' is not set. Option D is wrong because it would be 'no'.
Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
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 'files' section only includes '**/*' which does not preserve paths.
Why it's wrong here
The glob '**/*' includes all files but discard-paths causes flattening.
✓
The 'discard-paths' option is set to 'yes', which flattens the directory structure.
Why this is correct
When discard-paths is yes, all files are placed in the root without preserving paths.
Related concept
Static NAT maps one inside address to one outside address.
✗
The 'base-directory' is not specified, so CodeBuild uses the root of the build output.
Why it's wrong here
Base-directory controls the starting point for artifacts, not path preservation.
✗
The 'name' property is missing, causing artifacts to be stored without structure.
Why it's wrong here
The name property sets the artifact name, not the directory structure.
Common exam traps
Common exam trap: NAT rules depend on direction and matching traffic
NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.
Detailed technical explanation
How to think about this question
NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.
KKey Concepts to Remember
Static NAT maps one inside address to one outside address.
PAT allows many inside hosts to share one public address using ports.
Inside local and inside global describe the private and translated addresses.
NAT ACLs identify traffic for translation, not always security filtering.
TExam Day Tips
→Identify inside and outside interfaces first.
→Check whether the scenario needs static NAT, dynamic NAT or PAT.
→Do not confuse NAT matching ACLs with normal packet-filtering intent.
Key takeaway
NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
What to study next
Got this wrong? Here's your next step.
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related DOP-C02 NAT questions on configuration and troubleshooting.
SDLC Automation — This question tests SDLC Automation — Static NAT maps one inside address to one outside address..
What is the correct answer to this question?
The correct answer is: The 'discard-paths' option is set to 'yes', which flattens the directory structure. — Option A is correct because 'discard-paths: yes' flattens the structure. Option B is wrong because it only shows files. Option C is wrong because 'base-directory' is not set. Option D is wrong because it would be 'no'.
What should I do if I get this DOP-C02 question wrong?
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related DOP-C02 NAT questions on configuration and troubleshooting.
What is the key concept behind this question?
Static NAT maps one inside address to one outside address.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.