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.48.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cc76035d3b64e4ed544d0ee896be6e938c2d4c3e73228d4ad0913f128a11a75 |
|
MD5 | 21efce7503f4cb9396e06328ea5d3df5 |
|
BLAKE2b-256 | 6dd67ec83d39bd4c16e924ba1b6b5f3b8b660c33d1db537464005e344963c64e |
Close
Hashes for cdk_lambda_extensions-0.1.48-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2d99c743b56bfc4619368c6a1c8b5fb9df7f01476735f07d1dc7c5d3ae5106e |
|
MD5 | 80ba1e5bba41b691e359e931505f5c03 |
|
BLAKE2b-256 | c160888fd841e0756b99dd42eb9ec16b8e3049424a271435e7796c42ed4b48f9 |