aws sap 문제 풀이 12주차 문제풀이 4번

aws, sap, May 28, 2023

examptopics

Q27

A company is storing data in several Amazon DynamoDB tables. A solutions architect must use a serverless architecture to make the data accessible publicly through a simple API over HTTPS. The solution must scale automatically in response to demand. Which solutions meet these requirements? (Choose two.)

A. Create an Amazon API Gateway REST API. Configure this API with direct integrations to DynamoDB by using API Gateway’s AWS integration type. B. Create an Amazon API Gateway HTTP API. Configure this API with direct integrations to Dynamo DB by using API Gateway’s AWS integration type. C. Create an Amazon API Gateway HTTP API. Configure this API with integrations to AWS Lambda functions that return data from the DynamoDB tables. D. Create an accelerator in AWS Global Accelerator. Configure this accelerator with AWS Lambda@Edge function integrations that return data from the DynamoDB tables. E. Create a Network Load Balancer. Configure listener rules to forward requests to the appropriate AWS Lambda functions.

생각들

답은 A,C

Lambda가 있어야 된다고 알고있어서 C는 맞췄는데, 나머지 하나를 모르겠어서 틀렸다. 풀이를 보니 REST API 같은 경우, Lambda 가 없어도 APIGW에서 DDB로 Direct하게 연결될 수 있다고 한다.

오잉..? 이런 기능이 있었단 말인가

풀이 및 공부

만약 ddb에서 데이터를 조회한다던지, crud 를 해야할 경우 항상 lambda를 두어 처리했었는데, 위처럼 lambda말고 ddb를 바로 api gw의 integration type으로 설정할 수 있다.

그리고 아래처럼 mapping template 을 설정하고

아래 body로 api 를 쏘면

ddb의 putitem이 정상적으로 실행된다.


api gw의 rest api일 경우 이 기능을 사용할 수 있다.

참고

https://aws.amazon.com/ko/blogs/compute/using-amazon-api-gateway-as-a-proxy-for-dynamodb/

Comments