@scloud/cdk-patterns
Version:
Serverless CDK patterns for common infrastructure needs
40 lines (39 loc) • 1.7 kB
TypeScript
import { Function } from 'aws-cdk-lib/aws-lambda';
import { Construct } from 'constructs';
import { ZipFunctionProps } from './ZipFunction';
import { ContainerFunctionProps } from './ContainerFunction';
import { Table } from 'aws-cdk-lib/aws-dynamodb';
/**
*
*/
export interface DynamoDbStreamFunctionProps {
table: Table;
lambda: Function;
description?: string;
/** Filters are easier to create correctly using FilterCriteria and FilterRule. See: https://stackoverflow.com/a/70366319/723506 */
filters?: {
[key: string]: unknown;
}[];
}
/**
* A Lambda function triggered by scheduled Cloudwatch events.
*
* The default schedule is Schedule.cron({ minute: '11', hour: '1' })
* Which sets '11 1 * * ? *' (i.e. 1:11am every day)
*
* You can also pass an optional description for readability in the Cloudwatch view in the AWS console.
*/
export declare class DynamoDbStreamFunction extends Construct {
lambda: Function;
table: Table;
constructor(scope: Construct, id: string, props: DynamoDbStreamFunctionProps);
static node(scope: Construct, id: string, table: Table, functionProps?: ZipFunctionProps, filters?: {
[key: string]: unknown;
}[], description?: string | undefined): DynamoDbStreamFunction;
static python(scope: Construct, id: string, table: Table, functionProps?: ZipFunctionProps, filters?: {
[key: string]: unknown;
}[], description?: string | undefined): DynamoDbStreamFunction;
static container(scope: Construct, id: string, table: Table, functionProps?: ContainerFunctionProps, filters?: {
[key: string]: unknown;
}[], description?: string | undefined): DynamoDbStreamFunction;
}