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.90.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0033e0e9b75285ecc9e5d2b6ff440b5d526b4407ff4b12d16e4c22bf6cf047e5 |
|
MD5 | 93e72cb269c36264dbace723bc7befce |
|
BLAKE2b-256 | 4f608c7ed47131e1dda8966dfac707b44bd1468f21d5b8be1d3d743cf9e10dca |
Close
Hashes for cdk_lambda_extensions-0.1.90-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 876f93623b7d7b90103bc477bc3a1ede8799d2bdde18795847b5ec1f3c452745 |
|
MD5 | 56d1f8f31b0bafc2435b35a7a5d80372 |
|
BLAKE2b-256 | 9869c0aff441042f32c1c16a318af5605b5e1bf1537d2fc8e86c445006f0af1e |