How to Create an Automated CI/CD Pipeline with AWS Copilot and CodeCommit?

A developer is building a new containerized application by using AWS Copilot. The developer uses the AWS Copilot command line interface (CLI) to deploy the application during development. The developer committed the application code to a new AWS CodeCommit repository. The developer must create an automated deployment process before releasing the new application to production. What should the developer do to meet these requirements in the MOST operationally efficient way?

  1. Create a buildspec file that invokes the AWS Copilot CLI commands to build and deploy the application. Use the AWS Copilot CLI to create an AWS CodePipeline that uses the CodeCommit repository in the source stage and AWS CodeBuild in the build stage.
  2. 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.
  3. Use the AWS Copilot CLI to define the AWS Copilot pipeline and to deploy the AWS CodePipeline. Select CodeCommit as the source for the AWS CodePipeline. Source Reference Answer
  4. Define an AWS CloudFormation template for an AWS CodePipeline with CodeCommit as the source. Configure the template as an AWS Copilot CLI add-on. Use the AWS Copilot CLI to deploy the application.

Community Votes

C
67%
A
33%

67% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests knowledge of AWS Copilot's native pipeline capabilities, emphasizing operational efficiency over manual configuration.

AWS Copilot provides a built-in copilot pipeline init command to generate and deploy a CI/CD pipeline using AWS CodePipeline. This is the most operationally efficient approach compared to manually writing buildspec files or using third-party tools like SAM.

Many candidates choose Option A because it appears functional, but it requires manually creating a buildspec and pipeline configuration, which is less efficient than Copilot's native pipeline feature.

Community Discussion (8 comments)

examuserss 👍 1 Selected: C
Correct Answer: C. Use the AWS Copilot CLI to define the AWS Copilot pipeline and to deploy the AWS CodePipeline. Select CodeCommit as the source for the AWS CodePipeline. This option is the most operationally efficient solution, as it makes full use of AWS Copilot's built-in capabilities to define and deploy the automated pipeline with minimal effort.
preachr 👍 2 Selected: C
https://aws.github.io/copilot-cli/docs/concepts/pipelines/
wh1t4k3r 👍 1 Selected: C
Both A and C work, the key word is efficiency. C is the most efficient way.
65703c1 👍 2 Selected: A
A is the correct answer.
Lucky4Life 👍 1 Selected: C
Per Chatgpt
a1971h 👍 1 Selected: C
C ,,,,,,,,,,,,,,,,,,,
DeaconStJohn 👍 2 Selected: C
https://ecsworkshop.com/microservices/frontend/#deploy-frontend-0:~:text=on%20the%20pipeline.-,Creating%20the%20pipeline,-Generally%2C%20when%20we This workshop is linked from AWS docs @ https://docs.aws.amazon.com/AmazonECS/latest/developerguide/getting-started-aws-copilot-cli.html#:~:text=Step%206.%20Learn%20to%20create%20a%20CI/CD%20Pipeline Co-pilot CLI is a substitute for AWS console. As the question states the dev is using co-pilot I think this is the best answer, although option A is more suited to my experience.
komorebi 👍 2 Selected: A
The correct answer to ChetGPT is A

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why Option C is Correct

Option C leverages the AWS Copilot CLI's native pipeline functionality. The copilot pipeline init command automatically generates a buildspec.yml and a pipeline.yml (CloudFormation template) that defines an AWS CodePipeline with the correct stages (Source, Build, Deploy). Copilot then deploys this pipeline for you. This approach is the most operationally efficient because:

  • It requires zero manual configuration of CodePipeline or buildspec files.
  • Copilot natively understands the application's environment structure and configures the pipeline accordingly.
  • It fully integrates with the Copilot workflow, reducing the chance of misconfiguration.
As noted in community comments, this is the recommended approach per the [AWS Copilot documentation on pipelines](https://aws.github.io/copilot-cli/docs/concepts/pipelines/).

Why Other Options Are Incorrect

Option A works but is not the most operationally efficient. It requires the developer to manually write a buildspec.yml that invokes Copilot commands and then separately create a CodePipeline using Copilot. This introduces unnecessary manual steps and potential for errors.

Option B incorrectly introduces AWS SAM CLI, which is designed for serverless applications (Lambda, API Gateway), not containerized applications deployed via Copilot. Mixing SAM with Copilot adds complexity and is not a supported or efficient workflow.

Option D requires manually defining a CloudFormation template and configuring it as a Copilot add-on. This is unnecessarily complex and defeats the purpose of using Copilot to simplify deployment and pipeline management.

Key Takeaway

AWS Copilot is designed to abstract away the complexity of container orchestration and CI/CD. When the question asks for the MOST operationally efficient approach, always look for the option that leverages Copilot's built-in, native features rather than manual or hybrid configurations.

Official Reference

Exam Strategy

When a question emphasizes 'MOST operationally efficient,' prioritize native, built-in features of the service in question over manual or third-party configurations. AWS Copilot's pipeline command is purpose-built for this scenario.

Related Analysis

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide