LambdaFunctionProcessor

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

Bases: object

(experimental) Use an AWS Lambda function to transform records.

Stability:

experimental

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 = destinations.S3Bucket(bucket,
    processor=lambda_processor
)
firehose.DeliveryStream(self, "Delivery Stream",
    destinations=[s3_destination]
)
Parameters:
  • lambda_function (IFunction) –

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

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

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

Stability:

experimental

Methods

bind(_scope, *, role)

(experimental) 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) – (experimental) The IAM role assumed by Kinesis Data Firehose to write to the destination that this DataProcessor will bind to.

Stability:

experimental

Return type:

DataProcessorConfig

Attributes

props

(experimental) The constructor props of the LambdaFunctionProcessor.

Stability:

experimental