AWS CDK construct library that allows you to add any AWS Lambda extensions to the Lambda functions
Project description
cdk-lambda-extensions
AWS CDK construct library that allows you to add any AWS Lambda Extensions to the Lambda functions.
Sample
To add s3-logs-extension-demo
extension from the aws-lambda-extensions github repository:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
# prepare the s3 bucket for the lambda logs
bucket = s3.Bucket(self, "DemoBucket")
# prepare the Function
fn = Function(self, "Handler",
code=lambda_.Code.from_asset(path.join(__dirname, "../aws-lambda-extensions/s3-logs-extension-demo/functionsrc")),
runtime=lambda_.Runtime.PYTHON_3_8,
handler="lambda_function.lambda_handler",
memory_size=128,
environment={
"S3_BUCKET_NAME": bucket.bucket_name
}
)
bucket.grant_write(fn)
# plug the `s3-logs-extension` in the lambda function
fn.add_extension(S3LogsExtension(self, "S3BucketExtention").extension)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cdk-lambda-extensions-0.1.152.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d16378b10f5ec4a6dbbec32bbf9a8fcc6ca0144186bd44e37b7e7dd0c90feff |
|
MD5 | 8e1422881adb176412dbf2c02d370d54 |
|
BLAKE2b-256 | 20619540bde96fd86bc1526c47ae3c215f5da5be3ce9500bfb4d14512a78877f |
Close
Hashes for cdk_lambda_extensions-0.1.152-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d4513c29f3bf143e8a75ad0a147c693a7158b91ce46b01a6a4f79792a41dc5 |
|
MD5 | 96e3a4c2836eb27382a4a3c218d38c7d |
|
BLAKE2b-256 | 5b3fd670fcd8d7d86917cb9baedfb2b0207c583ec2458015783bb6a5e22c4980 |