AWS Certified Developer – Associate (DVA-C02)DeploymentMedium
A company is using AWS CodePipeline to deploy a serverless application consisting of a web frontend hosted on Amazon S3 and an API built with AWS Lambda and Amazon API Gateway. They want to implement an automated testing stage after the API deployment, but before the frontend deployment, to ensure the new API version is functional. Which CodePipeline action type should be used to run these API integration tests?
- AAmazon S3 deployment action
- BAWS CodeDeploy action (Lambda deployment)
- CManual approval action
- DAWS CodeBuild action
Show answer & explanationAnswer & explanation
Correct answer: D. AWS CodeBuild action
AWS CodeBuild is the ideal service for running automated tests (like API integration tests) within a CodePipeline. It can execute custom build commands, scripts, and test runners defined in a `buildspec.yml` file, making it suitable for validating the deployed API before proceeding with further stages.
Why the other options are wrong
- A. S3 deployment actions are for deploying artifacts to S3, not for running tests.
- B. CodeDeploy actions deploy applications; while they can have hooks, CodeBuild is specifically designed for general-purpose build and test execution.
- C. A manual approval action pauses the pipeline for human intervention, which is not an automated testing solution.
CodeBuild for Integration Tests
Using AWS CodeBuild within an AWS CodePipeline to execute automated integration tests (e.g., API tests) as a dedicated stage, ensuring deployed components function correctly before proceeding.
- Executes custom test scripts.
- Uses `buildspec.yml` for commands.
- Integrates seamlessly into CodePipeline.
Memory trick: TEST-PIPE: Tests Every Stage, To Ensure Perfection.