Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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.
*
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> {