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.244.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ed662130b1b20727349a4ea52102775b535a73a800cbdad0eea67e76c00581 |
|
MD5 | 6528e87b35122bb4b4b7ace9a7dba78e |
|
BLAKE2b-256 | 495604f574c10435dcde9b2b2e4ed1c0d3f8bdbebee78826c0be6c6b01d970dc |
Close
Hashes for cdk_lambda_extensions-0.1.244-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb8ea315305763f93ff3ce9f37e9d76b8bcee4366ee4c0352d4b1deee8ae2cdd |
|
MD5 | 30ddf74b4d8c59429e76faf86fd8b2a3 |
|
BLAKE2b-256 | f2643edd04e2d28482b1899151d6c49f31a148683bb006df7c1e737e1e43bccb |