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.146.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b86b29ce155e489cf61c09375010d1620addca6c0ab3d728a9d40d231ea32f4b |
|
MD5 | 95e449e75564b1f53095719e93bf549d |
|
BLAKE2b-256 | 62fb51ca4c13985f383b99e5ccc8ccbe607a0f130d9a97e38a24fd1e8445f4f1 |
Close
Hashes for cdk_lambda_extensions-0.1.146-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a82e53a0e1ba788d3d62feca6eeaf5d04088c1d537746fa9c92fb881d95dc70 |
|
MD5 | 0eb7c1469ab05fd8c426780dbedc744d |
|
BLAKE2b-256 | 51cdd6425fa8d1113bc50701c260a6791d1a7a140c4a71a88acc5a3eeb2cd107 |