ExamQuestions.com

Register
Login
AWS Certified Solutions Architect Professional Exam Questions

Amazon

AWS Certified Solutions Architect Professional

226 / 465

Question 226:

API gateway and Lambda proxy integrations have been chosen to implement an application by a software engineer. The application is a data analysis tool that returns some statistical results when the HTTP endpoint is called. The Lambda needs to communicate with some back-end data services such as Keen.io. However, there are chances that error happens, such as wrong data requested, bad communications, etc. The Lambda is written using Java. Two exceptions may be returned which are BadRequestException and InternalErrorException. What should the software engineer do to map these two exceptions in the API gateway with proper HTTP return codes? For example, BadRequestException and InternalErrorException are mapped to HTTP return codes 400 and 500 respectively. Select 2.

Answer options:

A.Add the corresponding error codes (400 and 500) on the Integration Response in the API gateway.
B.Add the corresponding error codes (400 and 500) on the Method Response in the API gateway.
C.Put the mapping logic into Lambda itself so that when an exception happens, error codes are returned at the same time in a JSON body.
D.Add Integration Responses where regular expression patterns are set, such as BadRequest or InternalError. Associate them with HTTP status codes.
E.Add Method Responses where regular expression patterns are set, such as BadRequest or InternalError. Associate them with HTTP status codes 400 and 500.