DOP-C02 Question 49
Select 2A DevOps team is building a CI/CD pipeline on AWS to manage the deployment of a serverless application. The team needs to generate build artifacts that will later be deployed to AWS Lambda. The build artifacts must be versioned, stored securely, and made available for deployment. Which methods can be used to create and generate these artifacts?
- A
Use AWS CodeBuild to compile the application code and store the generated artifacts in an S3 bucket
- B
Run a custom Jenkins job on an EC2 instance and save the build output to an EBS volume
- C
Use AWS CodePipeline with a build stage powered by AWS CodeBuild to generate and store the artifacts in an S3 bucket
- D
Manually compile the application on a local development machine and upload the artifacts to an S3 bucket
- E
Use AWS Elastic Beanstalk to package and directly deploy the application without generating artifacts
Show answer and explanation
Correct answers: A, C
Explanation
In a CI/CD pipeline on AWS, CodeBuild is a scalable and managed service designed for compiling and packaging application code. When integrated into CodePipeline, it can automate the artifact generation process and store the output securely in S3, which supports versioning and secure access. Manual compilation or storing on EBS volumes is neither scalable nor best practice, and Elastic Beanstalk is focused on deployment rather than artifact generation.
- A. Correct.
AWS CodeBuild is designed for compiling and packaging application code. It integrates seamlessly with S3 for storing build artifacts, making it a valid option for generating artifacts.
- B. Incorrect.
Running a Jenkins job on an EC2 instance can compile code, but storing artifacts on an EBS volume is not ideal for secure and versioned storage. EBS volumes are not designed for artifact storage in CI/CD pipelines.
- C. Correct.
AWS CodePipeline can orchestrate a build stage using AWS CodeBuild to generate build artifacts. These artifacts can then be stored in S3, which provides secure, versioned storage.
- D. Incorrect.
Manually compiling code on a local machine can generate artifacts, but it is not an automated, scalable, or secure method suitable for CI/CD pipelines.
- E. Incorrect.
AWS Elastic Beanstalk is an application deployment service rather than a tool for creating build artifacts. It is not intended for generating and storing artifacts independently.