Skip to main content

A Library that extends the aws_lambda.Code.from_asset and allows for auto packaging of the project

Project description

Pretty Downloader GitHub tag (latest SemVer) Python_Version GitHub PyPI - Downloads PyPI - Downloads

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

Latest PyPI stable release

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-cdk-code-builder-1.1.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

aws_cdk_code_builder-1.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file aws-cdk-code-builder-1.1.1.tar.gz.

File metadata

  • Download URL: aws-cdk-code-builder-1.1.1.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

Hashes for aws-cdk-code-builder-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2fe2319f4eb9e85dc483c54d2650176cc17a5756079327f96f8d84c533cb73ca
MD5 de1ec4b8ea3bc97b02c69f35f32e9f0d
BLAKE2b-256 20b9b2a141239612ef84edcece6510d3e823cfc6156dbc01d5c942e407ddfa71

See more details on using hashes here.

File details

Details for the file aws_cdk_code_builder-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_cdk_code_builder-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4580d2cf36f8e12b1d64691f7ad8893a9a6580c4b3301c59d24e012006103b7
MD5 3f3153461f364b8ea6e297a9faa19323
BLAKE2b-256 e96d6a5928303c7fe46012ced187fc3fcb376fa3198fe84da6508ea7c6f2ca66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page