Class LambdaFunctionProcessor
(experimental) Use an AWS Lambda function to transform records.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.KinesisFirehose
Assembly: Amazon.CDK.AWS.KinesisFirehose.dll
Syntax (csharp)
public class LambdaFunctionProcessor : DeputyBase, IDataProcessor
Syntax (vb)
Public Class LambdaFunctionProcessor
Inherits DeputyBase
Implements IDataProcessor
Remarks
Stability: Experimental
ExampleMetadata: lit=../aws-kinesisfirehose-destinations/test/integ.s3-bucket.lit.ts infused
Examples
using Path;
using Amazon.CDK.AWS.KinesisFirehose;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.Lambda.Nodejs;
using Amazon.CDK.AWS.Logs;
using Amazon.CDK.AWS.S3;
using Amazon.CDK;
using Amazon.CDK.AWS.KinesisFirehose.Destinations;
var app = new App();
var stack = new Stack(app, "aws-cdk-firehose-delivery-stream-s3-all-properties");
var bucket = new Bucket(stack, "Bucket", new BucketProps {
RemovalPolicy = RemovalPolicy.DESTROY,
AutoDeleteObjects = true
});
var backupBucket = new Bucket(stack, "BackupBucket", new BucketProps {
RemovalPolicy = RemovalPolicy.DESTROY,
AutoDeleteObjects = true
});
var logGroup = new LogGroup(stack, "LogGroup", new LogGroupProps {
RemovalPolicy = RemovalPolicy.DESTROY
});
var dataProcessorFunction = new NodejsFunction(stack, "DataProcessorFunction", new NodejsFunctionProps {
Entry = Join(__dirname, "lambda-data-processor.js"),
Timeout = Duration.Minutes(1)
});
var processor = new LambdaFunctionProcessor(dataProcessorFunction, new DataProcessorProps {
BufferInterval = Duration.Seconds(60),
BufferSize = Size.Mebibytes(1),
Retries = 1
});
var key = new Key(stack, "Key", new KeyProps {
RemovalPolicy = RemovalPolicy.DESTROY
});
var backupKey = new Key(stack, "BackupKey", new KeyProps {
RemovalPolicy = RemovalPolicy.DESTROY
});
new DeliveryStream(stack, "Delivery Stream", new DeliveryStreamProps {
Destinations = new [] { new S3Bucket(bucket, new S3BucketProps {
Logging = true,
LogGroup = logGroup,
Processor = processor,
Compression = Compression.GZIP,
DataOutputPrefix = "regularPrefix",
ErrorOutputPrefix = "errorPrefix",
BufferingInterval = Duration.Seconds(60),
BufferingSize = Size.Mebibytes(1),
EncryptionKey = key,
S3Backup = new DestinationS3BackupProps {
Mode = BackupMode.ALL,
Bucket = backupBucket,
Compression = Compression.ZIP,
DataOutputPrefix = "backupPrefix",
ErrorOutputPrefix = "backupErrorPrefix",
BufferingInterval = Duration.Seconds(60),
BufferingSize = Size.Mebibytes(1),
EncryptionKey = backupKey
}
}) }
});
app.Synth();
Synopsis
Constructors
LambdaFunctionProcessor(IFunction, IDataProcessorProps) | |
LambdaFunctionProcessor(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LambdaFunctionProcessor(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Props | (experimental) The constructor props of the LambdaFunctionProcessor. |
Methods
Bind(Construct, IDataProcessorBindOptions) | (experimental) Binds this processor to a destination of a delivery stream. |
Constructors
LambdaFunctionProcessor(IFunction, IDataProcessorProps)
public LambdaFunctionProcessor(IFunction lambdaFunction, IDataProcessorProps props = null)
Parameters
- lambdaFunction IFunction
- props IDataProcessorProps
Remarks
Stability: Experimental
LambdaFunctionProcessor(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LambdaFunctionProcessor(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LambdaFunctionProcessor(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LambdaFunctionProcessor(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Props
(experimental) The constructor props of the LambdaFunctionProcessor.
public virtual IDataProcessorProps Props { get; }
Property Value
Remarks
Stability: Experimental
Methods
Bind(Construct, IDataProcessorBindOptions)
(experimental) Binds this processor to a destination of a delivery stream.
public virtual IDataProcessorConfig Bind(Construct scope, IDataProcessorBindOptions options)
Parameters
- scope Constructs.Construct
- options IDataProcessorBindOptions
Returns
Remarks
Implementers should use this method to grant processor invocation permissions to the provided stream and return the necessary configuration to register as a processor.
Stability: Experimental