Q97 — AWS DVA-C02 Ch.3
Question 97 of 100 | ← Chapter 3
A developer is using AWS Copilot to build a new containerized application. The developer deploys the application during development using the AWS Copilot CLI. The application code is pushed to a new AWS CodeCommit repository. Before releasing the new application to production, the developer must create an automated deployment pipeline. To meet these requirements with maximum operational efficiency, what should the developer do?
- A. Create a buildspec file that invokes AWS Copilot CLI commands to build and deploy the application. Use the AWS Copilot CLI to create an AWS CodePipeline with CodeCommit as the source stage and AWS CodeBuild as the build stage.
- B. Use the AWS Serverless Application Model (AWS SAM) CLI to bootstrap and initialize an AWS CodePipeline configuration. Use the CodeCommit repository as the source. Invoke the AWS Copilot CLI to build and deploy the application.
- C. Use the AWS Copilot CLI to define an AWS Copilot pipeline and deploy AWS CodePipeline. Select CodeCommit as the source for the AWS CodePipeline. ✓
- D. Define an AWS CloudFormation template for AWS CodePipeline with CodeCommit as the source. Configure the template as an add-on to the AWS Copilot CLI. Use the AWS Copilot CLI to deploy the application.
Correct Answer: C. Use the AWS Copilot CLI to define an AWS Copilot pipeline and deploy AWS CodePipeline. Select CodeCommit as the source for the AWS CodePipeline.
Explanation
Option C is correct. AWS Copilot natively supports defining and deploying CI/CD pipelines via its CLI using the `copilot pipeline init` and `copilot pipeline deploy` commands. When initialized with CodeCommit as the source, Copilot automatically generates and deploys a fully configured AWS CodePipeline—including source, build (CodeBuild), and deploy (ECS/EKS) stages—without requiring manual CloudFormation authoring, external tooling (e.g., SAM), or custom buildspecs. This approach maximizes operational efficiency by leveraging Copilot’s opinionated, integrated pipeline automation. Options A, B, and D introduce unnecessary complexity, external dependencies, or unsupported configurations (e.g., SAM CLI doesn’t orchestrate Copilot pipelines; CloudFormation add-ons aren’t a Copilot feature).