简体   繁体   中英

How to enable Transform source records with AWS Lambda for Firehose with CDK

I'm trying to enable resource transformation (with Lambda) to Kinesis Firehose using CDK. I already know how to do this using the console, but I can't figure out how to implement this with the AWS CDK. This is the Code that I have so far using Typescript

// KINESIS STREAM
const kinesisStream = new kinesis.CfnDeliveryStream(this, `${props.name}-Kinesis`, {
  deliveryStreamName: `${props.name}-Stream`,
  deliveryStreamType: 'DirectPut',
  s3DestinationConfiguration: {
    bucketArn: props.eventsBucketArn,
    bufferingHints: {
      intervalInSeconds: 300,
      sizeInMBs: 5,
    },
    compressionFormat: 'UNCOMPRESSED',
    prefix: 'year=!{timestamp:yyyy}/month=!{timestamp:MM}/day=!{timestamp:dd}/hour=!{timestamp:HH}/',
    errorOutputPrefix: 'Errors/year=!{timestamp:yyyy}/month=!{timestamp:MM}/day=!{timestamp:dd}/hour=!{timestamp:HH}/!{firehose:error-output-type}',
    roleArn: kinesisRole.roleArn
  }
});

Thanks in advance for the help!

Check ProcessingConfigurationProperty . Java code:

List<Object> transformParams = new ArrayList<>();
transformParams.add(ProcessorParameterProperty.builder().
        parameterName("LambdaArn").
        parameterValue(transform.getFunctionArn()).
        build());
transformParams.add(ProcessorParameterProperty.builder().
        parameterName("RoleArn").
        parameterValue(transform.getRole().getRoleArn()).
        build());

extendedS3DestinationConfiguration(ExtendedS3DestinationConfigurationProperty.builder().
        cloudWatchLoggingOptions(CloudWatchLoggingOptionsProperty.builder().
                enabled(true).
                logGroupName(logGroup.getLogGroupName()).
                logStreamName(logStream.getLogStreamName()).
                build()).
        bucketArn(bucket.getBucketArn()).
        bufferingHints(BufferingHintsProperty.builder().
                intervalInSeconds(180).
                sizeInMBs(1).
                build()).
        compressionFormat("UNCOMPRESSED").
        roleArn(role.getRoleArn()).
        processingConfiguration(ProcessingConfigurationProperty.builder().
                enabled(Boolean.TRUE).
                processors(processors).
                build()).
        build()).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM