A Library that extends the aws_lambda.Code.from_asset and allows for auto packaging of the project
Project description
AWS CDK Code Builder
This library work very similarly to how AWS sam build
works. It will find the requirements.txt file and install all libraries and package them together with your code to then ship to a lambda function.
📝 CONTRIBUTIONS
Before doing any contribution read CONTRIBUTING.
📧 CONTACT
Email: amng835@gmail.com
General Discord: https://discord.gg/dFD5HHa
Developer Discord: https://discord.gg/rxNNHYN9EQ
📥 INSTALLING
pip install aws-cdk-code-builder
⚙ HOW TO USE
Folder tree (Simplified)
cdk_project
| -- lambda_function
| | -- main.py
| -- cdk_project
| | -- __init__.py
| | -- cdk_project_stack.py
| -- app.py
| -- ...
File: cdk_project_stack.py
import os
import aws_cdk
from aws_cdk import aws_lambda as lambda_
from aws_cdk_code_builder import Build
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_PATH = os.path.dirname(CURRENT_DIR)
LAMBDA_CODE = os.path.join(PARENT_PATH, 'lambda_function')
class CdkProjectStack(aws_cdk.Stack):
def __init__(self, scope: aws_cdk.Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
# This is a simplified representation of Function, more params are needed for it to compile
lambda_.Function(
code=Build(
project_path=LAMBDA_CODE,
work_dir=PARENT_PATH
).build(),
)
🤝 PARAMETERS
- project_path : str, required
- Path to the lambda function code
- work_dir : str, required
- Path to the working directory.
- Note: Build folder will be created in this path (
build/
)
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
File details
Details for the file aws-cdk-code-builder-1.1.3.tar.gz
.
File metadata
- Download URL: aws-cdk-code-builder-1.1.3.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49959b17d8bd744a70d42cffdcc1f5db3aac82f2dd996b32452f3ecba4d33de5 |
|
MD5 | da3e0e4a9e9db81979db09865d30963e |
|
BLAKE2b-256 | c496e92d8fc28a4b1480e38315ed447c018e8253a6d5cede9a6ecb9ace02b1ef |
File details
Details for the file aws_cdk_code_builder-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: aws_cdk_code_builder-1.1.3-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ffe3880055bd6631f6c1c05006829f2bd900e57b52c73874805c1a54d58028 |
|
MD5 | 4400ac1593bee8e3f3dbe561d81faa7d |
|
BLAKE2b-256 | 49fe6ac5d82494cdaba09e3aaeb96ead891d7648d1712f448a4b0fe9ceac9f21 |