From d4e43f711bfa945f0ba4a6e3efddbb1aa9cabd37 Mon Sep 17 00:00:00 2001 From: Rheinard Korf Date: Thu, 10 Jun 2021 09:57:24 +1000 Subject: [PATCH] Replaces Table class with ITable interface. This commit addresses issue #36. The Seeder works for new tables being created via CDK, but existing tables using `fromTableArn` or `fromTableAttributes` fail. Changing the Props type to ITable allows for new and existing tables. **Tests** Tests still pass successfully with this change. --- lib/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 012c0bb..b2be428 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,5 +1,5 @@ import { Construct, RemovalPolicy, Duration } from '@aws-cdk/core'; -import { Table } from '@aws-cdk/aws-dynamodb'; +import { ITable } from '@aws-cdk/aws-dynamodb'; import { Function, Runtime, Code } from '@aws-cdk/aws-lambda'; import { Bucket } from '@aws-cdk/aws-s3'; import { BucketDeployment, Source } from '@aws-cdk/aws-s3-deployment'; @@ -8,7 +8,7 @@ import * as tmp from 'tmp'; import * as fs from 'fs'; export interface Props { - readonly table: Table; + readonly table: ITable; readonly setup: Item[]; readonly teardown?: ItemKey[]; readonly refreshOnUpdate?: boolean;