@scavasoft/aws-cdk-dynamodb-to-elasticsearch-stream
Version:
AWS CDK based construct that enables you to easily stream data from a DynamoDB table to an ElasticSearch index.
44 lines (34 loc) • 1.21 kB
Markdown
//badge.fury.io/js/%40scavasoft%2Faws-cdk-dynamodb-to-elasticsearch-stream.svg)](https://www.npmjs.com/package/@scavasoft/aws-cdk-dynamodb-to-elasticsearch-stream)
AWS CDK based construct that enables you to easily stream data from a DynamoDB table to an ElasticSearch index.
npm install @scavasoft/aws-cdk-dynamodb-to-elasticsearch-stream
Use the construct as a "drop-in" replacement of the dynamodb.Table construct.
Before:
```typescript
import * as dynamodb from '@aws-cdk/aws-dynamodb';
new dynamodb.Table(this, 'table', {
partitionKey: {
name: "id",
type: AttributeType.STRING,
},
});
```
After:
```typescript
import * as elasticsearch from '@aws-cdk/aws-elasticsearch';
new DynamoDBWithElasticSearchStream(this, 'table', {
partitionKey: {
name: "id",
type: AttributeType.STRING,
},
streamTo: {
domain: new elasticsearch.Domain(this, 'elasticsearch', {
version: ElasticsearchVersion.V7_7,
}),
index: "some-elasticsearch-index",
}
});
```
A more in-depth example is available in the /examples subfolder.
[![npm version](https: