cdk-constructs icon indicating copy to clipboard operation
cdk-constructs copied to clipboard

[cdk-dynamodb-seeder] Fails to read JSON with error Unexpected token o in JSON at position 1

Open iabdelkareem opened this issue 1 year ago • 1 comments

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),
      });

iabdelkareem avatar Aug 08 '24 10:08 iabdelkareem

+1 for this, I have the same issue

TariqSaiyad avatar Apr 10 '25 20:04 TariqSaiyad