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

Class LambdaS3Code

python/lambda-with-existing-s3-code/app.py:9–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7# Creates reference to already existing s3 bucket and lambda code
8
9class LambdaS3Code(Stack):
10 def __init__(self, app: App, id: str) -> None:
11 super().__init__(app, id)
12
13 lambda_code_bucket = s3.Bucket.from_bucket_attributes(
14 self, 'LambdaCodeBucket',
15 bucket_name='my-lambda-code-bucket'
16 )
17
18 lambdaFn = lambda_.Function(
19 self, 'Singleton',
20 handler='index.main',
21 code=lambda_.S3Code(
22 bucket=lambda_code_bucket,
23 key='my-lambda.py'
24 ),
25 runtime=lambda_.Runtime.PYTHON_3_7,
26 timeout=Duration.seconds(300)
27 )
28
29
30app = App()

Callers 1

app.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected