update_stream_record_distribution_strategy¶
Operation¶
update_stream_record_distribution_strategy
¶
update_stream_record_distribution_strategy(request: UpdateStreamRecordDistributionStrategyInput | UpdateStreamRecordDistributionStrategyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateStreamRecordDistributionStrategyInputDict]) -> UpdateStreamRecordDistributionStrategyOutput
Updates the record distribution strategy for the specified Amazon Kinesis Data Streams on-demand data stream. The record distribution strategy determines how Amazon Kinesis Data Streams distributes records across the shards in a stream.
Note
You must specify the stream using the StreamARN parameter.
The record distribution strategy is a stream-level setting. You can switch between the following strategies at any time, and the change takes effect immediately without downtime, data loss, or disruption to producer or consumer applications:
-
AUTO-- Amazon Kinesis Data Streams distributes records evenly across shards using service-managed algorithms, and ignores any partition key andExplicitHashKeythat a producer provides. Use this strategy for stateless workloads that do not require partition-key ordering. -
USER_PARTITION_KEY-- Producers must provide a partition key, and Amazon Kinesis Data Streams uses the partition key to determine shard placement. Records that share a partition key are sent to the same shard. This is the default strategy.
This operation is only supported for data streams that use the on-demand
capacity mode. Provisioned capacity mode streams do not support the
record distribution strategy setting. Attempting to set AUTO on a
provisioned stream results in an InvalidArgumentException.
New records that arrive after the change are distributed according to the new strategy. Records already in the stream keep their original shard assignments and are not redistributed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateStreamRecordDistributionStrategyInput | UpdateStreamRecordDistributionStrategyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateStreamRecordDistributionStrategyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateStreamRecordDistributionStrategyOutput
|
An instance of |
update_stream_record_distribution_strategy
async
¶
update_stream_record_distribution_strategy(request: UpdateStreamRecordDistributionStrategyInput | UpdateStreamRecordDistributionStrategyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateStreamRecordDistributionStrategyInputDict]) -> UpdateStreamRecordDistributionStrategyOutput
Updates the record distribution strategy for the specified Amazon Kinesis Data Streams on-demand data stream. The record distribution strategy determines how Amazon Kinesis Data Streams distributes records across the shards in a stream.
Note
You must specify the stream using the StreamARN parameter.
The record distribution strategy is a stream-level setting. You can switch between the following strategies at any time, and the change takes effect immediately without downtime, data loss, or disruption to producer or consumer applications:
-
AUTO-- Amazon Kinesis Data Streams distributes records evenly across shards using service-managed algorithms, and ignores any partition key andExplicitHashKeythat a producer provides. Use this strategy for stateless workloads that do not require partition-key ordering. -
USER_PARTITION_KEY-- Producers must provide a partition key, and Amazon Kinesis Data Streams uses the partition key to determine shard placement. Records that share a partition key are sent to the same shard. This is the default strategy.
This operation is only supported for data streams that use the on-demand
capacity mode. Provisioned capacity mode streams do not support the
record distribution strategy setting. Attempting to set AUTO on a
provisioned stream results in an InvalidArgumentException.
New records that arrive after the change are distributed according to the new strategy. Records already in the stream keep their original shard assignments and are not redistributed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateStreamRecordDistributionStrategyInput | UpdateStreamRecordDistributionStrategyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateStreamRecordDistributionStrategyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateStreamRecordDistributionStrategyOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
UpdateStreamRecordDistributionStrategyInputDict
¶
Bases: TypedDict
Dictionary form of UpdateStreamRecordDistributionStrategyInput.
Attributes¶
record_distribution_strategy
instance-attribute
¶
The record distribution strategy to apply to the stream. Specify one of the following values:
-
AUTO-- Amazon Kinesis Data Streams distributes records evenly across shards and ignores any partition key andExplicitHashKeythat producers supply. -
USER_PARTITION_KEY-- Producers must supply a partition key, which Amazon Kinesis Data Streams uses to determine shard placement. This is the default.
stream_arn
instance-attribute
¶
The Amazon Resource Name (ARN) of the stream to update.
UpdateStreamRecordDistributionStrategyInput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateStreamRecordDistributionStrategyInput structure.
Attributes¶
record_distribution_strategy
class-attribute
instance-attribute
¶
record_distribution_strategy: str | None = ...
The record distribution strategy to apply to the stream. Specify one of the following values:
-
AUTO-- Amazon Kinesis Data Streams distributes records evenly across shards and ignores any partition key andExplicitHashKeythat producers supply. -
USER_PARTITION_KEY-- Producers must supply a partition key, which Amazon Kinesis Data Streams uses to determine shard placement. This is the default.
Output¶
UpdateStreamRecordDistributionStrategyOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateStreamRecordDistributionStrategyOutput structure.