DOP-C02 · Question #238
A company uses an AWS CodeCommit repository to store its source code and corresponding unit tests. The company has configured an AWS CodePipeline pipeline that includes an AWS CodeBuild project that…
The correct answer is A. Configure the CodeBuild project to use native Git to done the CodeCommit repository. Configure. Explanation Option A is correct because using native Git to clone the CodeCommit repository gives CodeBuild full Git functionality, including the ability to create and push tags back to the repository after a successful test run - this is essential since tagging requires Git…
Question
A company uses an AWS CodeCommit repository to store its source code and corresponding unit tests. The company has configured an AWS CodePipeline pipeline that includes an AWS CodeBuild project that runs when code is merged to the main branch of the repository. The company wants the CodeBuild project to run the unit tests. If the unit tests pass, the CodeBuild project must tag the most recent commit. How should the company configure the CodeBuild project to meet these requirements?
Options
- AConfigure the CodeBuild project to use native Git to done the CodeCommit repository. Configure
- BConfigure the CodeBuild projed to use native Git to done the CodeCommit repository. Configure
- CConfigure the CodeBuild project to use AWS CLI commands to copy the code from the
- DConfigure the CodeBuild project to use AWS CLI commands to copy the code from the
How the community answered
(37 responses)- A84% (31)
- B5% (2)
- C8% (3)
- D3% (1)
Explanation
Explanation
Option A is correct because using native Git to clone the CodeCommit repository gives CodeBuild full Git functionality, including the ability to create and push tags back to the repository after a successful test run - this is essential since tagging requires Git write access and the ability to push to the remote repository.
Options B, C, and D are distractors: Option B likely differs from A in a subtle configuration detail (such as credential setup or IAM role permissions) that would prevent the tag from being successfully pushed back to CodeCommit. Options C and D use AWS CLI commands to copy code, which only downloads a static snapshot of the source files - this approach lacks Git context (no .git directory), making it impossible to create or push Git tags back to the repository after tests pass.
Memory Tip: Think of it this way - if you need to do Git things (like tagging commits), you need a real Git clone, not just a file copy. Whenever a CodeBuild question involves Git operations (tagging, branching, committing), native Git cloning is the answer, and the CodeBuild service role must have the necessary IAM permissions to authenticate and push back to CodeCommit.
Topics
Community Discussion
No community discussion yet for this question.