An application developer is designing a new serverless microservice using Amazon API Gateway. The microservice must ingest JSON payloads from client applications, perform minimal transformations using Velocity Mapping Templates (VTL) directly in API Gateway to format the payloads for a downstream service, and authenticate users using standard JSON Web Tokens (JWT) generated by an Amazon Cognito User Pool. The developer wants to minimize latency, custom code overhead, and management complexity.
Which of the following actions should the developer perform to meet these requirements? (Select TWO.)
- Configure a Lambda custom integration for the integration request and define a Velocity Mapping Template (VTL) to transform the payload.Cevap
- Configure an Amazon Cognito user pool authorizer on the API Gateway method to validate the client JWTs.Cevap
- CConfigure a Lambda proxy integration and define a Velocity Mapping Template (VTL) in the integration request to transform the payload.
- DCreate a custom Lambda authorizer that imports the AWS SDK to validate and decode the Cognito JWT for each request.
- EConfigure a Lambda proxy integration and use a method response mapping template to parse the incoming payload format.
Cevap
Configure a Lambda custom integration for the integration request and define a Velocity Mapping Template (VTL) to transform the payload, and configure an Amazon Cognito user pool authorizer on the API Gateway method to validate the client JWTs.
To transform payloads using Velocity Mapping Templates (VTL) before they reach the backend service, the developer must use a Lambda custom (non-proxy) integration because proxy integrations pass the raw event payload directly without allowing mapping templates. Additionally, to validate JWTs from Cognito with the lowest management overhead and custom code, the developer should configure the native Amazon Cognito user pool authorizer.
Adım Adım Çözüm
Anahtar Kavram
API Gateway Integrations and Authorizers
Tahmini Süre:2m 0s