I am using Boto3 with Kinesis. I want Kinesis to return a single item from the stream.
This is my code:
kinesis = boto3.client('kinesis')
iterator = kinesis.get_shard_iterator(
StreamName = "requests",
ShardIteratorType='LATEST'
)
response = kinesis.get_records(
ShardIterator = iterator,
Limit = 1,
StreamName = "requests",
)
print(response)
It fails with this error:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "ShardId"
on the line where I initialize the iterator, so I know I'm missing a parameter, but what do I set ShardId
to? If the answer varies from stream to stream, what exactly is a ShardId
?
Thanks in advance!