AWS以编程方式更新kinesis firehose配置

时间:2018-11-22 00:38:20

标签: amazon-web-services boto3 amazon-kinesis-firehose

当前,我正在编写一个测试库来测试配置设置。我只想设置Firehose的几个参数,例如SizeInMBs和IntervalInSeconds。所有其他参数将保持不变。有简单的方法吗?

1 个答案:

答案 0 :(得分:0)

我写了以下方法

def set_firehose_buffering_hints(self, size_mb, interval_sec): response = self._firehose_client.describe_delivery_stream(DeliveryStreamName=self.firehose) lambdaarn = (response['DeliveryStreamDescription'] ['Destinations'][0]['ExtendedS3DestinationDescription'] ['ProcessingConfiguration']['Processors'][0]['Parameters'][0]['ParameterValue']) response = self._firehose_client.update_destination(DeliveryStreamName=self.firehose, CurrentDeliveryStreamVersionId=response['DeliveryStreamDescription']['VersionId'], DestinationId=response['DeliveryStreamDescription']['Destinations'][0]['DestinationId'], ExtendedS3DestinationUpdate={ "BufferingHints": { "IntervalInSeconds": interval_sec, "SizeInMBs": size_mb }, 'ProcessingConfiguration': { 'Processors': [{ 'Type': 'Lambda', 'Parameters': [ { 'ParameterName': 'LambdaArn', 'ParameterValue': lambdaarn }, { 'ParameterName': 'BufferIntervalInSeconds', 'ParameterValue': str(interval_sec) }, { 'ParameterName': 'BufferSizeInMBs', 'ParameterValue': str(size_mb) }] }] }})