UpdateShardCount
Written by
Updated at February 10, 2023
Updates the number of shards in the specified stream. Only an increase in the shard count is allowed.
If successful, the method changes the stream status to UPDATING
and returns HTTP code 200 and data in JSON format. Once updated, the stream status changes to ACTIVE
. The scaling time depends on the stream size and may take several minutes. While the stream is in the UPDATING
status, data reads and writes do not stop.
Request
The request contains data in JSON format.
{
"ScalingType": "string",
"StreamName": "string",
"TargetShardCount": number
}
Request parameters
Parameter | Description |
---|---|
ScalingType |
The type of scaling. UNIFORM_SCALING creates shards of the same size.Type: String Possible values: UNIFORM_SCALING Required: Yes |
StreamName |
The name of the stream. Type: String Size: 1 -128 characters.Possible values: [a-zA-Z][a-zA-Z0-9-]+*(?<!-)$ Required: Yes |
TargetShardCount |
The target number of shards. Type: Integer Minimum value: 1 Required: Yes |
Response
If successful, HTTP code 200 and data in JSON format are returned.
{
"CurrentShardCount": number,
"StreamName": "string",
"TargetShardCount": number
}
Response parameters
Parameter | Description |
---|---|
CurrentShardCount |
The current number of shards. Type: Integer Minimum value: 1 Required: Yes |
StreamName |
The name of the stream. Type: String Size: 1 -128 characters.Possible values: [a-zA-Z][a-zA-Z0-9-]+*(?<!-)$ Required: Yes |
TargetShardCount |
The target number of shards. Type: Integer Minimum value: 1 Required: Yes |
Errors
Parameter | Description | HTTP code |
---|---|---|
InvalidArgumentException |
The argument is invalid. For more information, see the error message. | 400 |
LimitExceededException |
The request limit is exceeded. | 400 |
ResourceInUseException |
The resource is being used by another operation. | 400 |
ResourceNotFoundException |
The requested resource was not found. | 400 |
Errors that are common to all methods may occur.