cdk-constructs
cdk-constructs copied to clipboard
[cdk-dynamodb-seeder] Fails to read JSON with error Unexpected token o in JSON at position 1
When using DynamoDBSeeder with Seeds from either json file or bucket the creation of Custom::DynamodbSeeder resource fails with Unexpected token o in JSON at position 1. I checked that the file gets uploaded to S3 correctly (in case fromJsonFile is used) and has a valid JSON array.
Packages: CDK: 2.147.0 Constructs: 10.3.0 @cloudcomponents/cdk-dynamodb-seeder: 2.4.0
const seeder = new DynamoDBSeeder(this, 'TemplatesSeeder', {
table: templatesTable,
seeds: Seeds.fromBucket(
s3.Bucket.fromBucketArn(
this,
'Seeder',
'[bucket]'
),
'[key]'
),
});
const seeder = new DynamoDBSeeder(this, 'TemplatesSeeder', {
table: templatesTable,
seeds: Seeds.fromJsonFile(initialTemplatesFilePath),
});
+1 for this, I have the same issue