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.232.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c242440ef7310954a416b5f013b717e72d7619c5a3e7c41a61635686ead53d4 |
|
MD5 | e89d12ec4b5ed73e6eb8b9a586fad5fa |
|
BLAKE2b-256 | 00947250519ffffa40f5cab421bf1f463eb6440c16f6b832a1211c86f530afa7 |
Close
Hashes for cdk_lambda_extensions-0.1.232-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 161896ea1a6eed079b2194fb3078f0eb45e65749a7f72f09731b9ddf40f112a2 |
|
MD5 | 5e9202b636e31709244c61cd713d39a9 |
|
BLAKE2b-256 | 5c8dbc5e701b14db20a1b3deeac2b8650d784f5b5687dcadbd526c80ba20f0fc |