[AWS] api gateway - Kinesis json

on_cloud·2023년 4월 3일
0

AWS

목록 보기
7/13
post-thumbnail

참고 https://docs.aws.amazon.com/ko_kr/kinesis/latest/APIReference/API_Operations.html

input KDS

{
  "StreamName": "<kds name>",
  "Data": "$util.base64Encode($input.body)",
  "PartitionKey": "$context.requestId"
}

input KDS - query string


{
  "StreamName": $input.params('stream'),
  "Data": "$util.base64Encode($input.body)",
  "PartitionKey": "$context.requestId"
}

output Shard ID


{
	$input.json("$.ShardId")
}

TEST Request body

{
  	"name": "test",
	"text": "helloworld",
	"age": 19
}

input Data - curl

curl \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
    	"<key>": "<value>"
    '} \
    "https://<api gateway ID>/<deploy name>"

input Data - curl (api key)

curl \
    -X POST \
    -H "Content-Type: application/json" \
    -H "x-api-key: <api key>" \
    -d '{
    	"<key>": "<value>"
    '} \
    "https://<api gateway ID>/<deploy name>"
profile
클라우드 엔지니어가 목표인 학생

0개의 댓글