Which combination of steps should the developer take next to meet these requirements with the LEAST overhead?
(Choose two.)
Create an AWS CodeCommit project. Add the repository package’s build and test commands to the project’s buildspec.
Create an AWS CodeBuild project. Add the repository package’s build and test commands to the project’s buildspec.
Create an AWS CodeDeploy project. Add the repository package’s build and test commands to the project’s buildspec.
Add an action to the source stage. Specify the newly created project as the action provider. Specify the build artifact as the action’s input artifact.
Add a new stage to the pipeline after the source stage. Add an action to the new stage. Specify the newly created project as the action provider. Specify the source artifact as the action’s input artifact.
Explanations:
AWS CodeCommit is not necessary since the code is already in a GitHub repository. Creating a CodeCommit project adds overhead without meeting the requirement of running tests on the existing GitHub repository.
Creating an AWS CodeBuild project allows the developer to configure build and test commands in the buildspec file, which can be integrated into the pipeline to run unit tests against the application code stored in GitHub.
AWS CodeDeploy is primarily used for deployment purposes rather than running tests. While it manages application deployments, it does not have a buildspec for defining test commands. Thus, it does not meet the requirement of running unit tests.
While adding an action to the source stage might seem reasonable, it would not accomplish the goal of running tests. The build and test commands need to be specified in a separate build action, not as a source action.
Adding a new stage after the source stage to include a build action is the correct approach. It allows the developer to specify the CodeBuild project (from option B) as the action provider and utilize the source artifact to run unit tests in the deployment environment.