LambdaFunctionProcessor

class aws_cdk.aws_kinesisfirehose.LambdaFunctionProcessor(lambda_function, *, buffer_interval=None, buffer_size=None, retries=None)

Bases: object

Use an AWS Lambda function to transform records.

ExampleMetadata:

infused

Example:

# bucket: s3.Bucket
# Provide a Lambda function that will transform records before delivery, with custom
# buffering and retry configuration
lambda_function = lambda_.Function(self, "Processor",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "process-records"))
)
lambda_processor = firehose.LambdaFunctionProcessor(lambda_function,
    buffer_interval=Duration.minutes(5),
    buffer_size=Size.mebibytes(5),
    retries=5
)
s3_destination = firehose.S3Bucket(bucket,
    processor=lambda_processor
)
firehose.DeliveryStream(self, "Delivery Stream",
    destination=s3_destination
)
Parameters:
  • lambda_function (IFunction) –

  • buffer_interval (Optional[Duration]) – The length of time Amazon Data Firehose will buffer incoming data before calling the processor. s Default: Duration.minutes(1)

  • buffer_size (Optional[Size]) – The amount of incoming data Amazon Data Firehose will buffer before calling the processor. Default: Size.mebibytes(3)

  • retries (Union[int, float, None]) – The number of times Amazon Data Firehose will retry the processor invocation after a failure due to network timeout or invocation limits. Default: 3

Methods

bind(_scope, *, role)

Binds this processor to a destination of a delivery stream.

Implementers should use this method to grant processor invocation permissions to the provided stream and return the necessary configuration to register as a processor.

Parameters:
  • _scope (Construct) –

  • role (IRole) – The IAM role assumed by Amazon Data Firehose to write to the destination that this DataProcessor will bind to.

Return type:

DataProcessorConfig

Attributes

props

The constructor props of the LambdaFunctionProcessor.