A developer is creating a high-performance REST API using Amazon API Gateway that must write incoming JSON payloads directly into an Amazon DynamoDB table. To minimize latency and operational costs, the developer decides to use an AWS service integration instead of invoking an intermediate AWS Lambda function. Which two configurations are required to successfully set up this direct integration? (Select TWO.)
- Configure an integration request of type AWS Service, targeting DynamoDB and specifying the PutItem action, and assign an IAM role that allows API Gateway to perform the PutItem operation.Cevap
- Create an integration request mapping template for the application/json content type to transform the incoming JSON payload into the format required by the DynamoDB PutItem API.Cevap
- CEnable Lambda proxy integration on the method request to automatically format and forward the incoming JSON payload to the DynamoDB endpoint.
- DConfigure a custom Lambda authorizer to automatically map the incoming request headers to the DynamoDB primary key attributes.
- EConfigure an IAM role trust policy that allows the DynamoDB service principal (dynamodb.amazonaws.com) to assume the role used by API Gateway.
Cevap
To set up a direct API Gateway integration with DynamoDB, the developer must configure an integration request of type AWS Service targeting DynamoDB with the PutItem action and an API Gateway execution role, and create an integration request mapping template for application/json to format the payload.
To connect API Gateway directly to DynamoDB without an intermediate Lambda function, an AWS Service integration must be configured. This requires specifying the target service, action (PutItem), and an IAM execution role that allows API Gateway to write to the table. Additionally, because DynamoDB expects a specific JSON format containing attribute types (e.g., specifying string values with 'S'), an integration request mapping template is required to transform the incoming client JSON payload into the DynamoDB PutItem format.
Adım Adım Çözüm
Anahtar Kavram
API Gateway Direct AWS Service Integration with DynamoDB