import { Construct } from 'constructs'; import { Code, Runtime } from 'aws-cdk-lib/aws-lambda'; import { Lambda, LambdaProps } from './Lambda'; import { Tables } from './Tables'; import { Api } from './Api'; export declare type LambdasPropsOptionalRuntimeAndCode = Omit & { code?: Code; runtime?: Runtime; }; /** * Any prop that can be set on an individual lambda can be set on this * construct and all lambdas made in this group will have those values. Only * the props 'name', 'description' and 'handler' cannot be set as a group as * thats not possible. * * 'runtime' and 'code' are Omitted as they are allowed as optional props but * required by the Lambda construct. See information below for each of those * * By default the individual props will get merged in with the ones set for * the group and anything specifically set on one lambda will supercede the * group values. ie if runtime is set on the LambdasProps as * Runtime.NODEJS_14_X and on an individual lambda, in the LambdasProps.lambdas * array, as Runtime.NODEJS_10_X, then the function will use node 10.X * */ export interface LambdasProps extends Partial> { /** * An array of LambdaProps objects where the `runtime` and `code` are optional * While technically required they can be optionally passed as shared props and * that will get merged with each set of individual props and creation time. */ lambdas?: LambdasPropsOptionalRuntimeAndCode[]; /** * Runtime to use with all lambdas in this group. */ runtime?: Runtime; /** * Code to use with all lambdas in this group. Can pass a string to the * absolute path of the code folder and the AssetCode will be created for * you. You can also pass in any Construct that extends Code ie: * InlineCode, AssetCode, S3Code, etc. */ code?: Code | string; /** * Can pass a Tables object to the Lambdas object. That was you can use * LambdaProps.table as a string to reference the table that should be * associated. Makes building the lambdas array easier. */ tables?: Tables; } export declare class Lambdas extends Construct { resources: { [name: string]: Lambda; }; api?: Api; private globalProps; constructor(scope: Construct, id: string, props: LambdasProps); addLambda(props: LambdasPropsOptionalRuntimeAndCode): Lambda; }