KinesisClient.subscribe_to_shard
rboto-kinesis==0.4.0 · Service index · Types
Model summary (excerpt): This operation establishes an HTTP/2 connection between the consumer you specify in the ConsumerARN parameter and the shard you specify in the ShardId parameter. After the connection is successfully established, Kinesis Data Streams pushes records from the shard to the consumer over this connection. Before you call this operation, call RegisterStreamConsumer to register the consumer with...
Install and imports
from rboto import KinesisClient
from rboto_kinesis.types import (
StartingPosition,
SubscribeToShardOutput,
)
Signature
async def subscribe_to_shard(
*,
consumer_arn: str,
shard_id: str,
starting_position: StartingPosition,
stream_id: str | None = None,
dry_run: bool | None = None,
) -> SubscribeToShardOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
consumer_arn |
Yes | For this parameter, use the value you obtained when you called RegisterStreamConsumer . |
shard_id |
Yes | The ID of the shard you want to subscribe to. To see a list of all the shards for a given stream, use ListShards . |
starting_position |
Yes | The starting position in the data stream from which to start streaming. |
stream_id |
No | Not Implemented. Reserved for future use. |
dry_run |
No | Checks if your request will succeed. DryRun is an optional parameter. |
Output
SubscribeToShardOutput.
Typed response mapping, accessed as response["field"].
| Field | Type | Presence | References |
|---|---|---|---|
event_stream |
AsyncIterator[SubscribeToShardEventStream] |
Always present | SubscribeToShardEventStream |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
StartingPosition, SubscribeToShardOutput
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
Output streams: SubscribeToShardOutput.
Consume with async for. Do not reuse a consumed stream.
Errors
Import from rboto_kinesis.exceptions:
AccessDeniedError, DryRunOperationError, InternalFailureError, InvalidArgumentError, KMSAccessDeniedError, KMSDisabledError, KMSInvalidStateError, KMSNotFoundError, KMSOptInRequiredError, KMSThrottlingError, LimitExceededError, ResourceInUseError, ResourceNotFoundError.
Stream decoding may also raise the linked modeled event errors.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.