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.107.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d16ce784cddf6b326462d2bfd718db1955fd4c746e5f31a444ddd0955260342d |
|
MD5 | 81380b9405cc51738064c87024be8999 |
|
BLAKE2b-256 | 63cb8a6fa9c6cdf0b0c38c4e934694cb57e0852f074a2678cfe9ce706b8078ea |
Close
Hashes for cdk_lambda_extensions-0.1.107-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faf3b3ff6ee6a4e9963613352a09d3f5fc4072fa1ba9b3befb10200f23f21f6b |
|
MD5 | 8dd5f76aa782a80b3c9a4f934f137e45 |
|
BLAKE2b-256 | 4eb2cbfc2d7993a425aaf9bbf0c2ea605ad8af8e68018ee0cd7f2add1064a9eb |