aws-cdk-code-builder-1.2.3
توضیحات
A Library that extends the aws_lambda.Code.from_asset and allows for auto packaging of the project
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aws-cdk-code-builder-1.2.3 |
| نام | aws-cdk-code-builder |
| نسخه کتابخانه | 1.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | DeadSec-Security |
| ایمیل نویسنده | amng835@gmail.com |
| آدرس صفحه اصلی | https://github.com/DEADSEC-SECURITY/aws-cdk-code-builder |
| آدرس اینترنتی | https://pypi.org/project/aws-cdk-code-builder/ |
| مجوز | - |
# 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 <a href="https://github.com/DEADSEC-SECURITY/aws-cdk-code-builder/blob/main/CONTRIBUTING.md">CONTRIBUTING</a>.
## 📧 CONTACT
Email: amng835@gmail.com
General Discord: https://discord.gg/dFD5HHa
Developer Discord: https://discord.gg/rxNNHYN9EQ
## 📥 INSTALLING
<a href="https://pypi.org/project/aws-cdk-code-builder">Latest PyPI stable release</a>
```bash
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``
```python
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/``)
نیازمندی
| مقدار | نام |
|---|---|
| >=2.50.0 | aws-cdk-lib |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aws-cdk-code-builder-1.2.3:
pip install aws-cdk-code-builder-1.2.3.whl
نصب پکیج tar.gz aws-cdk-code-builder-1.2.3:
pip install aws-cdk-code-builder-1.2.3.tar.gz