@nona-creative/aws-cdk-lambda
v1.0.2
Published
AWS Lambda package with CDK
Downloads
3
Readme
AWS Lambda (CDK)
Installation
npm i -S @nona-creative/aws-cdk-lambda
Usage
Configure the build Lambda function
const _buildLambdaFunction = buildLambdaFunction( Code.fromAsset(codeAssetsZipFile), `${this.id}-handlers`, `${this.id}-lambda-${this.stage}`, )
optionally with VPC:
const functionProps = { vpc: this.vpcStack.vpc, securityGroup: this.vpcStack.securityGroups[LAMBDA_VPC_SECURITY_GROUP_NAME], vpcSubnets: { subnetType: SubnetType.PRIVATE }, } const _buildLambdaFunction = buildLambdaFunction( Code.fromAsset(codeAssetsZipFile), `${this.id}-handlers`, `${this.id}-lambda-${this.stage}`, functionProps, )
Build functions as needed, eg.
const getBooksLambda = _buildLambdaFunction(stack, 'getBooks', environment) const createBookLambda = _buildLambdaFunction(stack, 'createBook', environment)