Skip to content

Commit e4c9f50

Browse files
refactor: updates pointing lambda function to the handler based on new structure
1 parent ea4b0de commit e4c9f50

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/cdk/constructs/LambdaFunction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface LambdaFunctionProps {
2424
readonly functionName: string
2525
readonly packageBasePath: string
2626
readonly entryPoint: string
27+
readonly handler: string
2728
readonly environmentVariables: {[key: string]: string}
2829
readonly additionalPolicies?: Array<IManagedPolicy>
2930
readonly role?: Role
@@ -132,7 +133,7 @@ export class LambdaFunction extends Construct {
132133
memorySize: 256,
133134
timeout: Duration.seconds(50),
134135
architecture: Architecture.X86_64,
135-
handler: "app.handler",
136+
handler: props.handler,
136137
code: Code.fromAsset(props.packageBasePath),
137138
role,
138139
environment: {

packages/cdk/resources/Functions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class Functions extends Construct {
4343
functionName: `${props.stackName}-CreateIndexFunction`,
4444
packageBasePath: "packages/createIndexFunction",
4545
entryPoint: "app.py",
46+
handler: "app.handler",
4647
logRetentionInDays: props.logRetentionInDays,
4748
logLevel: props.logLevel,
4849
environmentVariables: {"INDEX_NAME": props.collectionId},
@@ -54,7 +55,8 @@ export class Functions extends Construct {
5455
stackName: props.stackName,
5556
functionName: `${props.stackName}-SlackBotFunction`,
5657
packageBasePath: "packages/slackBotFunction",
57-
entryPoint: "app.py",
58+
entryPoint: "app/main.py",
59+
handler: "app.main.handler",
5860
logRetentionInDays: props.logRetentionInDays,
5961
logLevel: props.logLevel,
6062
additionalPolicies: [props.slackBotManagedPolicy],

0 commit comments

Comments
 (0)