How to use @aws-cdk/aws-kinesis - 2 common examples

To help you get started, we’ve selected a few @aws-cdk/aws-kinesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github punchcard / punchcard / examples / lib / stream-processing.ts View on Github external
depends: enrichments.readAccess(),
  }, async(message, e) => {
    // here we transform messages received from SQS by looking up some data in DynamoDB
    const enrichment = await e.get({
      key: message.key
    });

    return {
      ...message,
      tags: enrichment ? enrichment.tags : [],
      timestamp: new Date()
    };
  })
  .toKinesisStream(stack, 'Stream', {
    // encrypt values in the stream with a customer-managed KMS key.
    encryption: StreamEncryption.KMS,

    // partition values across shards by the 'key' field
    partitionBy: value => value.key,

    // type of the data in the stream
    shape: struct({
      key: string(),
      count: integer(),
      tags: array(string()),
      timestamp
    })
  });

/**
 * Persist Kinesis Stream data as a tome-series Glue Table.
 * 
github punchcard / punchcard / packages / @punchcard / data-lake / lib / data-pipeline.ts View on Github external
constructor(scope: Build, id: string, props: DataPipelineProps) {
    scope = scope.map(scope => new core.Construct(scope, id));
    // super(scope, id);

    this.stream = new Kinesis.Stream(scope, 'Stream', {
      shape: struct(props.schema.shape),
      encryption: StreamEncryption.KMS
    });

    this.bucket = new S3.Bucket(scope.map(scope => new s3.Bucket(scope, 'Bucket', {
      encryption: s3.BucketEncryption.KMS_MANAGED,
    })));

    this.table = this.stream
      .toFirehoseDeliveryStream(scope, 'ToS3').objects()
      .toGlueTable(scope, 'ToGlue', {
        bucket: this.bucket.resource,
        database: props.database,
        tableName: props.schema.schemaName,
        columns: props.schema.shape,
        partition: {
          keys: Period.PT1M.schema,
          get(record): RuntimeShape> {

@aws-cdk/aws-kinesis

The CDK Construct Library for AWS::Kinesis

Apache-2.0
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis

Popular @aws-cdk/aws-kinesis functions