Skip to content

Latest commit

 

History

History
288 lines (151 loc) · 10.5 KB

File metadata and controls

288 lines (151 loc) · 10.5 KB

API Reference

Classes

Name Description
DynamoDBSeeder No description
InlineSeeds Seeds from an inline json object (limited to 4KiB).
JsonFileSeeds Seeds from a local json file.
S3Seeds Seeds from an S3 archive.
Seeds No description

Structs

Name Description
DynamoDBSeederProps No description
SeedsConfig No description

class DynamoDBSeeder

Implements: IConstruct, IConstruct, IConstruct, IDependable Extends: Construct

Initializer

new DynamoDBSeeder(scope: Construct, id: string, props: DynamoDBSeederProps)
  • scope (Construct) No description
  • id (string) No description
  • props (DynamoDBSeederProps) No description
    • seeds (Seeds) No description
    • table (ITable) No description
    • timeout (Duration) The function execution time (in seconds) after which Lambda terminates the function. Default: Duration.minutes(15)

class InlineSeeds

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

Extends: Seeds

Initializer

new InlineSeeds(seeds: string)
  • seeds (string) No description

Methods

bind(_scope)

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

bind(_scope: Construct): SeedsConfig

Returns:

class JsonFileSeeds

Seeds from a local json file.

Extends: Seeds

Initializer

new JsonFileSeeds(path: string, options?: AssetOptions)
  • path (string) No description
  • options (AssetOptions) No description
    • exclude (Array) Glob patterns to exclude from the copy. Default: nothing is excluded
    • follow (FollowMode) A strategy for how to handle symlinks. Default: Never
    • assetHash (string) Specify a custom hash for this asset. Default: based on assetHashType
    • assetHashType (AssetHashType) Specifies the type of hash to calculate for this asset. Default: the default is AssetHashType.SOURCE, but if assetHash is explicitly specified this value defaults to AssetHashType.CUSTOM.
    • bundling (BundlingOptions) Bundle the asset by executing a command in a Docker container. Default: uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
    • readers (Array<IGrantable>) A list of principals that should be able to read this asset from S3. Default: No principals that can read file asset.
    • sourceHash (string) Custom hash to use when identifying the specific version of the asset. Default: automatically calculate source hash based on the contents of the source file or directory.

Properties

Name Type Description
path string

Methods

bind(scope)

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

bind(scope: Construct): SeedsConfig

Returns:

class S3Seeds

Seeds from an S3 archive.

Extends: Seeds

Initializer

new S3Seeds(bucket: IBucket, key: string, objectVersion?: string)
  • bucket (IBucket) No description
  • key (string) No description
  • objectVersion (string) No description

Methods

bind(_scope)

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

bind(_scope: Construct): SeedsConfig

Returns:

class Seeds

Implemented by: InlineSeeds, JsonFileSeeds, S3Seeds

Initializer

new Seeds()

Methods

bind(scope)

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

bind(scope: Construct): SeedsConfig

Returns:

static fromBucket(bucket, key, objectVersion?)

static fromBucket(bucket: IBucket, key: string, objectVersion?: string): S3Seeds
  • bucket (IBucket) The S3 bucket.
  • key (string) The object key.
  • objectVersion (string) Optional S3 object version.

Returns:

static fromInline(seeds)

static fromInline(seeds: Array<Map<string, any>>): InlineSeeds
  • seeds (Array<Map<string, any>>) The actual json code (limited to 4KiB).

Returns:

static fromJsonFile(path, options?)

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

static fromJsonFile(path: string, options?: AssetOptions): JsonFileSeeds
  • path (string) Path to json seeds file.
  • options (AssetOptions) No description
    • exclude (Array) Glob patterns to exclude from the copy. Default: nothing is excluded
    • follow (FollowMode) A strategy for how to handle symlinks. Default: Never
    • assetHash (string) Specify a custom hash for this asset. Default: based on assetHashType
    • assetHashType (AssetHashType) Specifies the type of hash to calculate for this asset. Default: the default is AssetHashType.SOURCE, but if assetHash is explicitly specified this value defaults to AssetHashType.CUSTOM.
    • bundling (BundlingOptions) Bundle the asset by executing a command in a Docker container. Default: uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
    • readers (Array<IGrantable>) A list of principals that should be able to read this asset from S3. Default: No principals that can read file asset.
    • sourceHash (string) Custom hash to use when identifying the specific version of the asset. Default: automatically calculate source hash based on the contents of the source file or directory.

Returns:

struct DynamoDBSeederProps

Name Type Description
seeds Seeds
table ITable
timeout? Duration The function execution time (in seconds) after which Lambda terminates the function.
Default: Duration.minutes(15)

struct SeedsConfig

Obtainable from: InlineSeeds.bind(), JsonFileSeeds.bind(), S3Seeds.bind(), Seeds.bind()

Name Type Description
inlineSeeds? string Inline seeds.
Optional
s3Location? Location The location of the seeds in S3.
Optional