我试图在AWS Kinesis中实现动态分片。我创建了一个示例python脚本,使用Boto3库更新kinesis流中的分片计数,以将python与AWS Kinesis连接。
但是当我使用update_shard_count
方法时,它会提供 Kinesis对象无属性update_shard_count 错误。
import boto3
client = boto3.client('kinesis',region_name='us-east-1')
response = client.update_shard_count(
StreamName='xyzstream',
TargetShardCount=2,
ScalingType='UNIFORM_SCALING' )
回溯(最近一次呼叫最后一次):文件"",第1行,in AttributeError:' Kinesis'对象没有属性 ' update_shard_count'
然后我如何使用API更新kinesis分片计数?
答案 0 :(得分:0)
你必须升级你的Boto3。我有Boto3 1.4.3,我在Kinesis模块中看到了update_shard_count
方法。接下来我检查旧版本,但没有看到方法。
>>> 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>>
旧版
>>> import boto3
>>> boto3.__version__
'1.4.0'
>>> client = boto3.client('kinesis')
>>> client.update_shard_count
Traceback(最近一次调用最后一次):文件“”,第1行,in AttributeError:'Kinesis'对象没有属性 'update_shard_count'