Aws_kinesis_stream - unable to switch between PROVISIONED and ON_DEMAND mode

Switching between PROVISIONED and ON_DEMAND capacity mode fails in aws kinesis stream provison.

Error: shard_count must not be set when stream_mode is ON_DEMAND

Could you please help