Skip to content

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

@iabdelkareem

Description

@iabdelkareem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions