Coder Social home page Coder Social logo

aws-cdk-code-builder's Introduction

AWS CDK Code Builder GitHub tag (latest SemVer) Python_Version GitHub

PyPI - Downloads 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: [email protected]

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/)

aws-cdk-code-builder's People

Contributors

deadsec-security avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.