B.TwilioSdkLayer
An AWS CDK based lambda layer containing Twilio SDK for python.
Description
This library is intended to simplify Twilio SDK dependency management in AWS architectures where Twilio logic is being handled with lambda functions. Simply include this layer when creating a lambda function to enable Twilio functionality.
NOTE! In order to use this layer, a docker command must be available
on your machine. It is because the CDK runs a bundling command on a
docker container to create the Twilio dependency.
Remarks
Biomapas aims to modernise life-science industry by sharing its IT knowledge with other companies and the community. This is an open source library intended to be used by anyone. Improvements and pull requests are welcome.
Related technology
- Python 3
- AWS CDK
- Twilio
Assumptions
The project assumes the following:
- You have basic-good knowledge in python programming.
- You have basic-good knowledge in AWS and AWS CDK.
- You have basic knowledge in Twilio.
Useful sources
- Read more about Twilio SDK:
https://www.twilio.com/docs/libraries/python
Install
The project is built and uploaded to PyPi. Install it by using pip.
pip install b_twilio_sdk_layer
Or directly install it through source.
pip install .
Usage & Examples
Create a lambda function with this layer:
from aws_cdk.aws_lambda import Function, Code, Runtime
from b_twilio_sdk_layer.layer import Layer as TwilioLayer
from b_cfn_lambda_layer.package_version import PackageVersion
Function(
scope=stack,
id='MyCoolFunction',
function_name='MyCoolFunction',
code=Code.from_asset('/path/to/your/code'),
handler='index.handler',
runtime=Runtime.PYTHON_3_8,
layers=[TwilioLayer(
stack,
'MyCoolTwilioLayer',
twilio_sdk_version=PackageVersion.from_string_version('7.4.0')
)],
)
Testing
This package has integration tests based on pytest. To run tests simply run:
pytest b_twilio_sdk_layer_test/integration/tests
Contribution
Found a bug? Want to add or suggest a new feature?
Contributions of any kind are gladly welcome. You may contact us
directly, create a pull-request or an issue in github platform.
Lets modernize the world together.
Release history
1.0.1
- Set aws-cdk@1.x strict version.
1.0.0
- Restructure project. Start using the new b-cfn-lambda-layer Layer implementation.
- Add Twilio layer test.
- Add support for Twilio Python SDK version parameter.
0.0.8
- Ensure consistent builds.
0.0.7
- Add -R option for better debugging.
0.0.6
- Add latest boto version to tests.
0.0.5
- Add ability to bundle boto3 library. Simply specify version in the constructor.
0.0.4
- Update Docker bundling commands. Use bash to move files between directories instead of installing with
-tflag. Related issue: https://github.com/pypa/pip/issues/103
0.0.3
- Add disclaimer that
dockeris required.
0.0.2
- Ensure that cdk application works by running
cdk synthcommand.
0.0.1
- Initial build.
- Twilio SDK 6.46.0.
- Docker image for asset building: python:3.9.
Metadata
Release files for b-twilio-sdk-layer 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| b_twilio_sdk_layer-1.0.1.tar.gz | 7.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| b_twilio_sdk_layer-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / b_twilio_sdk_layer-1.0.1.tar.gz
| Download URL | b_twilio_sdk_layer-1.0.1.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64e6fa1f95c0d05eb5d940c7fcfaccd07471f0141eab3b52bcde2d9ef6483e8f
|
|
BLAKE2b-256 checksum How to use checksums |
6ba1eb705f2ecf272edfcb05b2bf91c94136c8eb67609620117846d345b2f9bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
|
Release files / b_twilio_sdk_layer-1.0.1-py3-none-any.whl
| Download URL | b_twilio_sdk_layer-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22fe94502f27c0525e3cecbf062bf13c52bfa4af9f15e74f49d57971afc035c2
|
|
BLAKE2b-256 checksum How to use checksums |
2b5fb86dec5b25e27572efc9d81fd6349a2a88be52dbf616b1987692e253fc12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
|
Security for b-twilio-sdk-layer 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.