put_records() only accepts keyword arguments in Kinesis boto3 Python API

后端 未结 2 1096
刺人心
刺人心 2021-02-10 07:05
from __future__ import print_function # Python 2/3 compatibility
import boto3
import json
import decimal

#kinesis = boto3.resource(\'kinesis\', region_name=\'eu-west-1\         


        
2条回答
  •  囚心锁ツ
    2021-02-10 07:34

    When passing multiple records, you need to encapsulate the records in a list of records, and then add the stream identifier.

    Format is like so:

    {
       "Records": [ 
          { 
             "Data": blob,
             "ExplicitHashKey": "string",
             "PartitionKey": "string"
          },
          {
             "Data": "another record",
             "ExplicitHashKey": "string",
             "PartitionKey": "string"
          }
       ],
       "StreamName": "string"
    }
    

    See the Kinesis docs for more info.

提交回复
热议问题