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. 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.250.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8768380d51c641f1c425b0cdbad84fd058b6c99788ee1abd085d260ee28636c |
|
MD5 | c54dae798de205895ac20351f5f82487 |
|
BLAKE2b-256 | 325fcf53e7f559c3183f7d991fae65d3c100769bce7cfdeb9a40e0eef9cc9419 |
Close
Hashes for cdk_lambda_extensions-0.1.250-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c0c9007803168d7b5f17ed3ce192947e64c94c59873192ab74aaab7c01da1d |
|
MD5 | 6b410a40c40f5082a63bf62033840a09 |
|
BLAKE2b-256 | 49ec81f7395b7dbee7e44996d6acc6c4b395052481593e37e87466322e3ed423 |