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.39.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20ac2a88178d5b09408627f0b799d5825bbb22e43ed6d9f63964f92a3506e065 |
|
MD5 | fdcd3fb8e7edc3179286411f9bee9b39 |
|
BLAKE2b-256 | 0d95bd8324a1835d886f2239a348a8ca975cb16c7d3bde99016c6b7fe25febe9 |
Close
Hashes for cdk_lambda_extensions-0.1.39-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 630e114eb85824106a08f155062b0658a90309b70c00b0957579b629cbb9664e |
|
MD5 | d8a588f5ca42298e29c475e6a2060fe8 |
|
BLAKE2b-256 | a5fdf2dc0e1da5caf0d5d3215d3b6384542a5d30f0d237f73995bfe87dc955af |