B.NodeCdkLayer
Description
This is a simple Lambda layer AWS CDK resource that contains node and aws cdk cli within.
This package is useful for lambda functions that want to run aws cdk commands within themselves.
Imagine a scenario where you run cdk deploy --all command not within you local pc or a build environment
but through a lambda function. This library would greatly help you.
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
- Python3
- Docker
- AWS CDK
Assumptions
This project assumes you have:
- Good knowledge in AWS.
- Good knowledge in AWS CDK.
- Good Python skills and basis of OOP.
Useful sources
- Read more about how Docker is ued when building custom lambda layers:
https://docs.aws.amazon.com/cdk/api/v1/python/aws_cdk.aws_lambda/Code.html#aws_cdk.aws_lambda.Code.from_docker_build
Install
Before installing this library, ensure you have these tools setup:
- Python / Pip
To install this project from source run:
pip install .
Or you can install it from a PyPi repository:
pip install b-node-cdk-layer
Usage & Examples
Simply create a lambda function with this layer:
from aws_cdk.aws_lambda import Function
from b_node_cdk_layer.node_cdk_layer import NodeCdkLayer
Function(
scope=Stack(...),
id='Function',
...,
layers=[NodeCdkLayer(Stack(...))],
# Running node process requires more RAM and longer runtime.
timeout=Duration.minutes(1),
memory_size=512
)
To run some node or cdk command, follow this example:
import subprocess
# This is the path to AWS CDK CLI. It comes from a NodeCDK layer, that is a custom-built layer using docker.
CDK_CLI_PATH = '/opt/bin/node_modules/aws-cdk/bin/cdk'
def handler(*args, **kwargs):
output = subprocess.check_output([
CDK_CLI_PATH,
'--version',
])
print(output)
Testing
This package has unit tests based on pytest. To run tests simply run:
pytest b_node_cdk_layer_test/integration
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
0.1.0
- Release build. Package works as intended.
0.0.1
- Initial build.
Metadata
Release files for b-node-cdk-layer 0.1.0
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_node_cdk_layer-0.1.0.tar.gz | 9.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| b_node_cdk_layer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / b_node_cdk_layer-0.1.0.tar.gz
| Download URL | b_node_cdk_layer-0.1.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c36ae2ea7a9ec97181ede89a519142bafba93172749653299afcfe7480867df
|
|
BLAKE2b-256 checksum How to use checksums |
60a990ce068c2334b4f6dbaf1d831f0650c44cc364f454f5124a7fc87b2ac26a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / b_node_cdk_layer-0.1.0-py3-none-any.whl
| Download URL | b_node_cdk_layer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f2a3ef0394bd9bf6aa77d880468055a2eed93ba774afb79d7848770e0e8f84a
|
|
BLAKE2b-256 checksum How to use checksums |
8257a3ae7a450990b5dc27cbe0b84601cdb1e7516c09ceeee9ec69064c54e84c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Security for b-node-cdk-layer 0.1.0
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.