in example/index.ts [13:48]
constructor(scope: Construct, id: string, props: StackProps = {}) {
super(scope, id, props);
const table1 = new dynamodb.Table(this, 'DynamoTable1', {
writeCapacity: 10,
partitionKey: {
name: 'ID',
type: dynamodb.AttributeType.STRING,
},
});
const writeTraffic = new TrafficDriver(this, 'WriteTraffic', {
table: table1,
write: true,
});
const readTraffic = new TrafficDriver(this, 'WriteReadTraffic', {
table: table1,
write: true,
read: true,
});
const alarmSqs = sqs.Queue.fromQueueArn(this, 'AlarmQueue', 'arn:aws:sqs:us-east-1:444455556666:alarm-queue')
const alarmSns = sns.Topic.fromTopicArn(this, 'AlarmTopic', 'arn:aws:sns:us-east-2:444455556666:MyTopic');
const watchful = new Watchful(this, 'watchful', {
alarmEmail: 'benisrae@amazon.com',
alarmSqs,
alarmSns,
});
watchful.watchDynamoTable('My Cute Little Table', table1);
watchful.watchScope(writeTraffic);
watchful.watchScope(readTraffic);
}