AWS Kinesis object has no attribute: update_shard_count

1k Views Asked by At

I'm trying to implement dynamic sharding in AWS Kinesis. I have created a sample python script to update the shard count in kinesis stream using Boto3 library to connect python with AWS Kinesis. But when I use update_shard_count method it is giving Kinesis object no attribute update_shard_count error.

import boto3

client = boto3.client('kinesis',region_name='us-east-1')
response = client.update_shard_count(
    StreamName='xyzstream',
    TargetShardCount=2,
    ScalingType='UNIFORM_SCALING' )

Traceback (most recent call last): File "", line 1, in AttributeError: 'Kinesis' object has no attribute 'update_shard_count'

Then how I can update kinesis shard count using API?

1

There are 1 best solutions below

0
On BEST ANSWER

You have to upgrade your Boto3. I have Boto3 1.4.3 and I see update_shard_count method in Kinesis module. Next I check in a older version and do not see the method.

    >>> import boto3
    >>> boto3.__version__
    '1.4.3'
    >>> client = boto3.client('kinesis')
    >>> client.update_shard_count
<bound method Kinesis.update_shard_count of <botocore.client.Kinesis object at 0x7fbfb7445b90>>

Old Version

>>> import boto3
>>> boto3.__version__
'1.4.0'
>>> client = boto3.client('kinesis')
>>> client.update_shard_count

Traceback (most recent call last): File "", line 1, in AttributeError: 'Kinesis' object has no attribute 'update_shard_count'