A CodePipeline deployment sometimes results in the web application's home page returning a 503 instead of the expected 200. You added a CheckURL stage after deployment that should fail the pipeline if the home page does not return 200 OK. What is the appropriate next step to implement this automated test?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Lambda function that requests the application URL, checks for a 200 response, and reports success or failure to CodePipeline. Configure an action in the CheckURL stage to invoke that Lambda function..
Why this is the answer
A Lambda function is the most direct and cost-effective way to implement a custom test like checking a URL for a 200 response within a CodePipeline stage. Lambda can execute custom code to perform the HTTP request and then use the PutJobSuccessResult or PutJobFailureResult API calls to report the outcome back to CodePipeline, failing the pipeline if the response is not 200. Using a CloudWatch action with a Canary is designed for continuous monitoring of endpoints, not as a direct pass/fail gate within a CodePipeline stage. While Canaries can check URLs, integrating their pass/fail status directly into a CodePipeline stage for immediate pipeline control is less straightforward than a Lambda function. CodeDeploy actions are for deploying applications, not for performing custom tests on deployed applications. Device Farm is for testing mobile applications on real devices, which is not applicable here.
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