1. 개념
➜ api 서버는 사용자로부터 다양한 요청을 수신
✅ 이 정보들은 LAMDA 함수로 전달 되고, 사용자 요청에 따라 LAMDA 함수에서 dynamodb 테이블에 데이터를 삽입/수정/삭제 등의 여러 가지 이벤트를 일으킴
2. 테이블 생성

3. API Gateway


➜ 리소스 생성

➜ 매서드 생성

➜ LAMDA 함수 생성



➜ 코드 삽입
{
'customer_id': '95IUZ',
'transaction_date': '2020-10-24',
'item_category': 'Desk',
'price': 120000
}

➜ LAMDA 함수에 코드 삽입
import boto3
resource = boto3.resource('dynamodb')
table = resource.Table('customer')
def lambda_handler(event, context):
table.put_item(Item=event)
return {"code":200, "message":"Data successfully Inserted!"}

✅ API Gateway에서 테스트

'AWS' 카테고리의 다른 글
| [ 18 ] - KMS (0) | 2024.10.15 |
|---|---|
| [ 17 ] - Cloudwatch X-ray (0) | 2024.10.15 |
| [ 15 ] - key (0) | 2024.10.11 |
| [ restart ] (0) | 2024.10.10 |
| [ 14 ] - 보안 모니터링 (0) | 2024.10.10 |