1.5.5 • Published 1 day ago

@fast-ninjas/cdk-constructs v1.5.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 day ago

Welcome to Cloudo

This repository contains high level AWS CDK constructs. These are designed for my personal and organizational use cases.

You may use it in your own projects if it fits your needs. Please do so at your own risk!

I do not guarantee these are good for your own use, bug free or safe to use.

Top Level Constructs

To create a any app, we would create one of these

  • API: A web API
  • StaticSite: A web site created from html css etc
  • Job: Some background job triggered by an event or a time schedule

APP -> CloudoApp -> Api | StaticSite | Job | - Bucket - Authentication -

import { ILayerVersion } from "aws-cdk-lib/aws-lambda";

type PythonFunctionV2Props = { path: string; description?: string; environment?: { key: string: string }; layers?: ILayerVersion[]; };

/**

  • Creates a new AWS Lambda function using python runtime.
  • @param path The path to the python function in the format "path/to/functionRootFolder".
  • When using poetry to manage dependencies path must be "path/to/functionRootFolder.poetry", the function root folder is the folder containing the pyproject.toml file.
  • The handler function must be in a file named "handler.py" in the package folder.
  • @param dependencyManager The dependency manager to use. Defaults to "poetry". */ export class PythonFunctionV2 extends Construct { constructor(scope: Construct, id: string, props: PythonFunctionV2Props) { super(scope, id);

    const { path, description, environment, layers } = props;
    
    let handlerFileName = "handler.py";
    let handlerFunctionName = "handler";
    let functionRootFolder = path;
    
    if (path.includes(".poetry")) {
      // Poetry project has a package folder with all lower case letters named the same as the project name
      const projectName = path.split(".").splice(-1)[0];
      handlerFileName = `${projectName.toLocaleLowerCase()}/handler.py`;
    }
    const f = new PythonLambdaFunction(this, "Function", {
      functionRootFolder: functionRootFolder,
      handlerFileName,
      handler: handlerFunctionName,
      description,
      environment,
      layers,
    });

    } }

1.5.5

1 day ago

1.5.4

3 days ago

1.5.3

3 days ago

1.5.2

3 days ago

1.5.1

2 months ago

1.5.0

2 months ago

1.4.5

2 months ago

1.4.3

2 months ago

1.4.2

2 months ago

1.4.1-beta.3

4 months ago

1.4.1-beta.2

4 months ago

1.4.1-beta.0

5 months ago

1.4.1-beta.1

5 months ago

1.4.0-beta.9

5 months ago

1.4.0-beta.8

5 months ago

1.4.0-alpha.0

6 months ago

1.2.0

10 months ago

1.4.0-alpha.1

6 months ago

1.0.1

10 months ago

1.4.0-alpha.2

6 months ago

1.4.0-alpha.3

6 months ago

1.2.2

9 months ago

1.0.3

10 months ago

1.4.0-alpha.8

6 months ago

1.4.0-alpha.9

6 months ago

1.4.0-alpha.4

6 months ago

1.4.0-alpha.5

6 months ago

1.4.0-alpha.6

6 months ago

1.4.0-alpha.7

6 months ago

1.3.0-alpha.6

7 months ago

1.3.0-alpha.5

8 months ago

1.3.0-alpha.8

7 months ago

1.3.0-alpha.9

7 months ago

0.2.13

7 months ago

0.2.12

9 months ago

0.2.11

10 months ago

0.2.10

10 months ago

1.4.0-beta.7

5 months ago

1.4.0-beta.6

6 months ago

1.4.0-beta.5

6 months ago

1.4.0-beta.4

6 months ago

1.4.0-beta.3

6 months ago

1.4.0-beta.2

6 months ago

1.4.0-beta.1

6 months ago

1.4.0-beta.0

6 months ago

1.3.0-alpha.2

8 months ago

1.3.0-alpha.1

8 months ago

1.3.0-alpha.4

8 months ago

1.3.0-alpha.3

8 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.3.1-alpha.1

7 months ago

1.3.1-alpha.2

7 months ago

0.2.7

10 months ago

0.2.9

10 months ago

0.2.8

10 months ago

1.3.1-alpha.4

7 months ago

0.2.6

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.18

11 months ago

0.1.17

12 months ago

0.1.15

12 months ago

0.1.13

1 year ago