MCPcopy Create free account
hub / github.com/aws-samples/aws-cdk-examples / LambdaLayerStack

Class LambdaLayerStack

python/lambda-layer/app.py:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class LambdaLayerStack(Stack):
8 def __init__(self, app: App, id: str) -> None:
9 super().__init__(app, id)
10
11 # create layer
12 layer = _lambda.LayerVersion(self, 'helper_layer',
13 code=_lambda.Code.from_asset("layer"),
14 description='Common helper utility',
15 compatible_runtimes=[
16 _lambda.Runtime.PYTHON_3_6,
17 _lambda.Runtime.PYTHON_3_7,
18 _lambda.Runtime.PYTHON_3_8
19 ],
20 removal_policy=RemovalPolicy.DESTROY
21 )
22 # create lambda function
23 function = _lambda.Function(self, "lambda_function",
24 runtime=_lambda.Runtime.PYTHON_3_8,
25 handler="index.handler",
26 code=_lambda.Code.from_asset("lambda"),
27 layers=[layer])
28
29
30app = App()

Callers 1

app.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected