Skip to content

Latest commit

 

History

History
898 lines (503 loc) · 14.8 KB

File metadata and controls

898 lines (503 loc) · 14.8 KB

README

@cloudcomponents/cdk-dynamodb-seeder

@cloudcomponents/cdk-dynamodb-seeder

Table of contents

Classes

Interfaces

Dynamo DB Seeder

@cloudcomponents/cdk-dynamodb-seeder / DynamoDBSeeder

Class: DynamoDBSeeder

Hierarchy

  • Construct

    DynamoDBSeeder

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DynamoDBSeeder(scope, id, props)

Parameters

Name Type
scope Construct
id string
props DynamoDBSeederProps

Overrides

Construct.constructor

Properties

node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node

Methods

onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Inline Seeds

@cloudcomponents/cdk-dynamodb-seeder / InlineSeeds

Class: InlineSeeds

Seeds from an inline json object (limited to 4KiB).

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new InlineSeeds(seeds)

Parameters

Name Type
seeds string

Overrides

Seeds.constructor

Methods

bind

bind(_scope): SeedsConfig

Called when the seeder is initialized to allow this object to bind to the stack.

Parameters

Name Type
_scope Construct

Returns

SeedsConfig

Overrides

Seeds.bind


fromBucket

Static fromBucket(bucket, key, objectVersion?): S3Seeds

Parameters

Name Type Description
bucket IBucket The S3 bucket
key string The object key
objectVersion? string Optional S3 object version

Returns

S3Seeds

S3Seeds associated with the specified S3 object.

Inherited from

Seeds.fromBucket


fromInline

Static fromInline(seeds): InlineSeeds

Parameters

Name Type Description
seeds Record<string, unknown>[] The actual json code (limited to 4KiB)

Returns

InlineSeeds

InlineSeeds with inline seeds.

Inherited from

Seeds.fromInline


fromJsonFile

Static fromJsonFile(path, options?): JsonFileSeeds

Loads the seeds from a local disk path and uploads it to s3.

Parameters

Name Type Description
path string Path to json seeds file.
options? AssetOptions -

Returns

JsonFileSeeds

JsonFileSeeds associated with the specified S3 object.

Inherited from

Seeds.fromJsonFile

Json File Seeds

@cloudcomponents/cdk-dynamodb-seeder / JsonFileSeeds

Class: JsonFileSeeds

Seeds from a local json file.

Hierarchy

  • Seeds

    JsonFileSeeds

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new JsonFileSeeds(path, options?)

Parameters

Name Type
path string
options AssetOptions

Overrides

Seeds.constructor

Properties

asset

Private Optional asset: Asset


path

Readonly path: string

Methods

bind

bind(scope): SeedsConfig

Called when the seeder is initialized to allow this object to bind to the stack.

Parameters

Name Type
scope Construct

Returns

SeedsConfig

Overrides

Seeds.bind


fromBucket

Static fromBucket(bucket, key, objectVersion?): S3Seeds

Parameters

Name Type Description
bucket IBucket The S3 bucket
key string The object key
objectVersion? string Optional S3 object version

Returns

S3Seeds

S3Seeds associated with the specified S3 object.

Inherited from

Seeds.fromBucket


fromInline

Static fromInline(seeds): InlineSeeds

Parameters

Name Type Description
seeds Record<string, unknown>[] The actual json code (limited to 4KiB)

Returns

InlineSeeds

InlineSeeds with inline seeds.

Inherited from

Seeds.fromInline


fromJsonFile

Static fromJsonFile(path, options?): JsonFileSeeds

Loads the seeds from a local disk path and uploads it to s3.

Parameters

Name Type Description
path string Path to json seeds file.
options? AssetOptions -

Returns

JsonFileSeeds

JsonFileSeeds associated with the specified S3 object.

Inherited from

Seeds.fromJsonFile

S 3 Seeds

@cloudcomponents/cdk-dynamodb-seeder / S3Seeds

Class: S3Seeds

Seeds from an S3 archive.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new S3Seeds(bucket, key, objectVersion?)

Parameters

Name Type
bucket IBucket
key string
objectVersion? string

Overrides

Seeds.constructor

Properties

bucketName

Private bucketName: string

Methods

bind

bind(_scope): SeedsConfig

Called when the seeder is initialized to allow this object to bind to the stack.

Parameters

Name Type
_scope Construct

Returns

SeedsConfig

Overrides

Seeds.bind


fromBucket

Static fromBucket(bucket, key, objectVersion?): S3Seeds

Parameters

Name Type Description
bucket IBucket The S3 bucket
key string The object key
objectVersion? string Optional S3 object version

Returns

S3Seeds

S3Seeds associated with the specified S3 object.

Inherited from

Seeds.fromBucket


fromInline

Static fromInline(seeds): InlineSeeds

Parameters

Name Type Description
seeds Record<string, unknown>[] The actual json code (limited to 4KiB)

Returns

InlineSeeds

InlineSeeds with inline seeds.

Inherited from

Seeds.fromInline


fromJsonFile

Static fromJsonFile(path, options?): JsonFileSeeds

Loads the seeds from a local disk path and uploads it to s3.

Parameters

Name Type Description
path string Path to json seeds file.
options? AssetOptions -

Returns

JsonFileSeeds

JsonFileSeeds associated with the specified S3 object.

Inherited from

Seeds.fromJsonFile

Seeds

@cloudcomponents/cdk-dynamodb-seeder / Seeds

Class: Seeds

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Seeds()

Methods

bind

Abstract bind(scope): SeedsConfig

Called when the seeder is initialized to allow this object to bind to the stack.

Parameters

Name Type Description
scope Construct The binding scope.

Returns

SeedsConfig


fromBucket

Static fromBucket(bucket, key, objectVersion?): S3Seeds

Parameters

Name Type Description
bucket IBucket The S3 bucket
key string The object key
objectVersion? string Optional S3 object version

Returns

S3Seeds

S3Seeds associated with the specified S3 object.


fromInline

Static fromInline(seeds): InlineSeeds

Parameters

Name Type Description
seeds Record<string, unknown>[] The actual json code (limited to 4KiB)

Returns

InlineSeeds

InlineSeeds with inline seeds.


fromJsonFile

Static fromJsonFile(path, options?): JsonFileSeeds

Loads the seeds from a local disk path and uploads it to s3.

Parameters

Name Type Description
path string Path to json seeds file.
options? AssetOptions -

Returns

JsonFileSeeds

JsonFileSeeds associated with the specified S3 object.

Dynamo DB Seeder Props

@cloudcomponents/cdk-dynamodb-seeder / DynamoDBSeederProps

Interface: DynamoDBSeederProps

Table of contents

Properties

Properties

seeds

Readonly seeds: Seeds


table

Readonly table: ITable


timeout

Optional Readonly timeout: Duration

The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time.

default Duration.minutes(15)

Seeds Config

@cloudcomponents/cdk-dynamodb-seeder / SeedsConfig

Interface: SeedsConfig

Table of contents

Properties

Properties

inlineSeeds

Optional Readonly inlineSeeds: string

Inline seeds.


s3Location

Optional Readonly s3Location: Location

The location of the seeds in S3.