[AWS] API Gateway - Kinesis

on_cloud·2023년 3월 30일
0

AWS

목록 보기
5/13
post-thumbnail

IAM


Kinesis Put Record - Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "kinesis:PutRecord"
            ],
            "Resource": "*"
        }
    ]
}

API Gateway - Kinesis Role

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "apigateway.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

Kinesis Data Streams


create Kinesis Data Streams


API Gateway


  1. API Gateway -> Crewate API -> Rest API -> Create API
  2. API Gateway -> Actions -> Create Method -> POST

  1. API Gateway -> Intergration Request -> HTTP Headers
    Content-Type = 'application/x-amz-json-1.1'

  2. API Gateway -> Intergration Request -> Mapping Templates
    Content-Type : application/json

  1. API Gateway -> Intergration Request -> Mapping Templates -> application/json
{
  "StreamName": "$input.params('stream')",
  "Data": "$util.base64Encode($input.body)",
  "PartitionKey": "$context.requestId"
}
  1. API Gateway -> Method Request -> Request Validator

  2. API Gateway -> Method Request -> Request Body
    Content-Type : application/json
    Model name : Empty

  3. API Gateway -> Method Request -> URL Query String
    Name : Stream

profile
클라우드 엔지니어가 목표인 학생

0개의 댓글