Skip to content

update_stream_record_distribution_strategy

Operation

update_stream_record_distribution_strategy

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 and ExplicitHashKey that 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 UpdateStreamRecordDistributionStrategyOutput.

update_stream_record_distribution_strategy async

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 and ExplicitHashKey that 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 UpdateStreamRecordDistributionStrategyOutput.

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
record_distribution_strategy: Required[str]

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 and ExplicitHashKey that 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
stream_arn: Required[str]

The Amazon Resource Name (ARN) of the stream to update.

stream_id instance-attribute
stream_id: str | None

Not Implemented. Reserved for future use.

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 and ExplicitHashKey that 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 class-attribute instance-attribute
stream_arn: str | None = ...

The Amazon Resource Name (ARN) of the stream to update.

stream_id class-attribute instance-attribute
stream_id: str | None = ...

Not Implemented. Reserved for future use.

Output

UpdateStreamRecordDistributionStrategyOutput dataclass

Bases: _SerdeShape

Dataclass for UpdateStreamRecordDistributionStrategyOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.