UNPKG

lambda-live-debugger

Version:

Debug Lambda functions locally like it is running in the cloud

84 lines (83 loc) 2.55 kB
import { LambdaResource } from '../types/resourcesDiscovery.js'; import { IFramework } from './iFrameworks.js'; import { AwsConfiguration } from '../types/awsConfiguration.js'; import { LldConfigBase } from '../types/lldConfig.js'; import { type BundlingOptions } from 'aws-cdk-lib/aws-lambda-nodejs'; /** * Support for AWS CDK framework */ export declare class CdkFramework implements IFramework { /** * Framework name */ get name(): string; /** * Can this class handle the current project * @returns */ canHandle(): Promise<boolean>; /** * Get Lambda functions * @param config Configuration * @returns Lambda functions */ getLambdas(config: LldConfigBase): Promise<LambdaResource[]>; /** * Getz Lambda functions from the CloudFormation template metadata * @param stackName * @param awsConfiguration * @returns */ protected getLambdaCdkPathFromTemplateMetadata(stackName: string, awsConfiguration: AwsConfiguration): Promise<Array<{ logicalId: string; cdkPath: string; }>>; /** * Get Lambdas data from CDK by compiling and running the CDK code * @param cdkConfigPath * @param config * @returns */ protected getLambdasDataFromCdkByCompilingAndRunning(cdkConfigPath: string, config: LldConfigBase): Promise<{ cdkPath: string; stackName: string; packageJsonPath: string | undefined; codePath: string; handler: string | undefined; bundling: BundlingOptions; }[]>; /** * Run CDK code in a node thread worker and return the Lambda functions * @param param0 * @returns */ protected runCdkCodeAndReturnLambdas({ config, awsCdkLibPath, compileCodeFile, }: { config: LldConfigBase; awsCdkLibPath: string | undefined; compileCodeFile: string; }): Promise<{ cdkPath: string; stackName: string; codePath?: string | undefined; code: { path?: string; }; handler: string; packageJsonPath: string; bundling: BundlingOptions; }[]>; /** * Get CDK context * @param cdkConfigPath * @param config * @returns */ protected getCdkContext(cdkConfigPath: string, config: LldConfigBase): Promise<{}>; /** * Get CDK entry file * @param cdkConfigPath * @returns */ getCdkEntryFile(cdkConfigPath: string): Promise<string>; } export declare const cdkFramework: CdkFramework;