Skip to content

Commit

Permalink
entry updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedharkb committed Mar 17, 2024
1 parent 633460d commit 2b2b325
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 1 addition & 8 deletions infrastructure/lib/stacks/api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ export class ApiStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

const pythonlayer = new LayerVersion(this,'PythonLayer',{
code: Code.fromAsset('../src/lambdas/api_lambda/'),
layerVersionName: `api-lambda-layer`,
description: "Layer for api Lambda python dependencies",
compatibleRuntimes: [Runtime.PYTHON_3_10],
})

new Function(this, 'ApiLambda', {
runtime: Runtime.PYTHON_3_10,
handler: 'api_lambda.app.lambda_handler',
handler: 'main.lambda_handler',
code: Code.fromAsset('../src/lambdas/api_lambda/'),
timeout: Duration.minutes(5),
layers:[pythonlayer]
});
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/lambdas/api_lambda/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from api_lambda.app import lambda_handler
if __name__ == "__main__":
lambda_handler({}, {})

0 comments on commit 2b2b325

Please sign in to comment.