A developer is designing a REST API using Amazon API Gateway that integrates directly with an Amazon DynamoDB table using an AWS service integration. The API needs to expose a POST method to insert customer records. To optimize throughput and performance, the developer wants to ensure that:
1. Incoming payloads are validated against a specific JSON schema, and requests with invalid structures are rejected with a Bad Request response before the integration is invoked.
2. The DynamoDB response, which contains the raw database attributes, is transformed into a simplified, customer-facing JSON format before being returned to the client.
Which two configuration steps must the developer perform in API Gateway to satisfy these requirements? (Select TWO.)
- Create a model representing the schema of the payload, assign the model to the method request, and enable request validation for the request body in the method settings.Cevap
- Configure an integration response for the HTTP status code, and write a mapping template using Velocity Template Language (VTL) to transform the DynamoDB response into the desired format.Cevap
- CDeploy a custom Lambda authorizer to parse the incoming request body, validate the schema structure, and return an IAM policy denying the request if attributes are missing.
- DUse a Lambda proxy integration with API Gateway to automatically route the client request directly to DynamoDB and apply the required VTL mapping templates.
- EConfigure a method response mapping template for the status code to directly parse the DynamoDB return attributes and output the client-facing JSON.