You need to add integration tests to an existing CodePipeline workflow that builds a container image for an Amazon ECS service and pushes the image to ECR with a new tag. The tests must verify that the new service version is reachable and that API endpoints return successful responses. An ECS cluster for testing already exists. Which three actions provide this with the least management overhead?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a Deploy stage to the pipeline and use Amazon ECS as the action provider., Have the image build stage produce an imagedefinitions.json file that references the new image tag., Create a Lambda function that runs connectivity checks and API calls against the deployed service and add it to the pipeline as a Lambda action..
Why this is the answer
To deploy the new container image to the existing ECS test cluster, you need a Deploy stage using Amazon ECS as the action provider. This allows CodePipeline to directly update the ECS service with the new image. For ECS deployments, the build stage must produce an imagedefinitions.json file. This file specifies the container image and tag to be used by the ECS deployment action, ensuring the correct version is deployed. Finally, to perform integration tests like connectivity checks and API calls, a Lambda function is an excellent choice. It can be easily integrated into the pipeline as a Lambda action, providing a serverless and low-overhead way to execute custom test logic against the newly deployed service. Using AWS CodeDeploy for ECS deployments is possible but adds more overhead than direct ECS integration. Adding an appspec.yml is relevant for CodeDeploy, not direct ECS deployments. Writing a script and invoking it via S3 is less integrated and more complex than using a Lambda function for custom test logic.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed