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.54.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44eab203551fbba03df41cfa38a8aaef10c29f1704b4aa12a6584bca3804aa0 |
|
MD5 | 5a0cfb0f94f7a05428c981a001f8f8d8 |
|
BLAKE2b-256 | 3dd4257741b4cd05b5f7aa989d1bc498da815df185a4206b65ec4c02747ef2d0 |
Close
Hashes for cdk_lambda_extensions-0.1.54-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 373226cc46153c7bd941c10b7eccba7553f86e74c24fc41f0bd02d1a3628472d |
|
MD5 | 091c4e77e69cd20292c2a9e277e42f34 |
|
BLAKE2b-256 | 307d0849dda1a1aa32890af7512df0dec82746cc87aefeb7c8a3f0385ac70dc8 |