amazon-redshiftaws-cdkamazon-kinesis-firehose

Python AWS CDK - Redshift as destination for kinesis firehose?


I'm looking for a way to configure redshift as a destination for kinesis firehose with the aws cdk (python). I'm not seeing any specific documentation on doing this like you can with s3.

https://docs.aws.amazon.com/cdk/api/v1/docs/aws-kinesisfirehose-readme.html

I'm looking into this, but it seems like a lower level method.

If using this, should I just drop it into the destination field?


Solution

  • The one you have shared seems the right approach.

    If you are using typescript, same can be written as below:

    // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import { aws_kinesisfirehose as kinesisfirehose } from 'aws-cdk-lib';
    const cfnDeliveryStream = new kinesisfirehose.CfnDeliveryStream(this, 'MyCfnDeliveryStream', /* all optional props */ {
    
      deliveryStreamName: 'deliveryStreamName',
      deliveryStreamType: 'deliveryStreamType',
    
      redshiftDestinationConfiguration: {
        clusterJdbcurl: 'clusterJdbcurl',
        copyCommand: {
          dataTableName: 'dataTableName',
    
          // the properties below are optional
          copyOptions: 'copyOptions',
          dataTableColumns: 'dataTableColumns',
        },
        password: 'password',
        roleArn: 'roleArn',
        s3Configuration: {
          bucketArn: 'bucketArn',
          roleArn: 'roleArn',
    
          // the properties below are optional
          bufferingHints: {
            intervalInSeconds: 123,
            sizeInMBs: 123,
          },
          cloudWatchLoggingOptions: {
            enabled: false,
            logGroupName: 'logGroupName',
            logStreamName: 'logStreamName',
          },
          compressionFormat: 'compressionFormat',
          encryptionConfiguration: {
            kmsEncryptionConfig: {
              awskmsKeyArn: 'awskmsKeyArn',
            },
            noEncryptionConfig: 'noEncryptionConfig',
          },
          errorOutputPrefix: 'errorOutputPrefix',
          prefix: 'prefix',
        },
        username: 'username',
    
        // the properties below are optional
        cloudWatchLoggingOptions: {
          enabled: false,
          logGroupName: 'logGroupName',
          logStreamName: 'logStreamName',
        },
        processingConfiguration: {
          enabled: false,
          processors: [{
            type: 'type',
    
            // the properties below are optional
            parameters: [{
              parameterName: 'parameterName',
              parameterValue: 'parameterValue',
            }],
          }],
        },
        retryOptions: {
          durationInSeconds: 123,
        },
        s3BackupConfiguration: {
          bucketArn: 'bucketArn',
          roleArn: 'roleArn',
    
          // the properties below are optional
          bufferingHints: {
            intervalInSeconds: 123,
            sizeInMBs: 123,
          },
          cloudWatchLoggingOptions: {
            enabled: false,
            logGroupName: 'logGroupName',
            logStreamName: 'logStreamName',
          },
          compressionFormat: 'compressionFormat',
          encryptionConfiguration: {
            kmsEncryptionConfig: {
              awskmsKeyArn: 'awskmsKeyArn',
            },
            noEncryptionConfig: 'noEncryptionConfig',
          },
          errorOutputPrefix: 'errorOutputPrefix',
          prefix: 'prefix',
        },
        s3BackupMode: 's3BackupMode',
      },
    
    });