calra-lambda


Namecalra-lambda JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCDK Ast Lambda Rest Api - Lambda Package
upload_time2024-05-14 00:18:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 CDK Ast Lambda Rest-API (Calra) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cdk lambda aws api gateway ast decorators
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CDK Ast Lambda Rest API - Lambda Packge (CALRA)

## A library for AWS API Gateway/Lambda Proxy Integration

CALRA allows simplified resource creation for AWS Lambda functions and Rest API resources by using decorators and setting a builder with default, common or custom values for IAM Roles, Runtimes, Timeouts, Layers, Environment values, etc.

This module provides the definition of decorators that are used within lambda handlers to add special configuration options for your Lambda Function.

### Installation

`calra_lambda` is available from PyPI as `calra-lambda`:

    pip install calra-lambda

You can as well rely on the [calra-example](https://https://github.com/cdk-ast-lambda-rest-api/calra-example) repository to get started.
To take full advantage of this package, installation of [calra-cdk](https://pypi.org/project/calra-cdk/) is recommended.

### Add decorators to your Lambda Handler

The decorators defined within this package are:

- GET, POST, PUT, DELETE, ANY are explicitly required for every handler and need to be defined with a custom path for your REST Endpoint.
- timeout will accept an integer value that will be transformed to duration in terms of seconds for a Lambda Function.
- memory_size will accept an integer value to specify the memory that will be assigned to each instance of your Lambda Function.
- name and description assign a custom string value passed as parameter to your Lambda Function's name and description.
- runtime, role, vpc. Each decorator receives a name string as identifier for a custom value defined for your stack using the [calra-cdk](https://pypi.org/project/calra-cdk/) module.
- environment, layer and security_group decorators can receive multi arguments or a list with the names of custom environment/layers/security_groups defined for your stack using the [calra-cdk](https://pypi.org/project/calra-cdk/) module.

```python
    from calra_lambda import *
    import json

    @GET('/dogs')
    @runtime('python3.11')
    @name('LBD-DOGS-GET')
    @memory_size(256)
    def lambda_handler(event, context):
        response = {
            'statusCode': 200,
            'body': json.dumps({
                'message': 'Hello World from /dogs!'
            })
        }
        return response
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "calra-lambda",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "cdk, lambda, aws, api gateway, ast, decorators",
    "author": null,
    "author_email": "Mateo Marcos <calra.github+mateo@gmail.com>, Emanuel Arguinarena <calra.github+emanuel@gmail.com>, Lucas Picchi <calra.github+lucas@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "# CDK Ast Lambda Rest API - Lambda Packge (CALRA)\n\n## A library for AWS API Gateway/Lambda Proxy Integration\n\nCALRA allows simplified resource creation for AWS Lambda functions and Rest API resources by using decorators and setting a builder with default, common or custom values for IAM Roles, Runtimes, Timeouts, Layers, Environment values, etc.\n\nThis module provides the definition of decorators that are used within lambda handlers to add special configuration options for your Lambda Function.\n\n### Installation\n\n`calra_lambda` is available from PyPI as `calra-lambda`:\n\n    pip install calra-lambda\n\nYou can as well rely on the [calra-example](https://https://github.com/cdk-ast-lambda-rest-api/calra-example) repository to get started.\nTo take full advantage of this package, installation of [calra-cdk](https://pypi.org/project/calra-cdk/) is recommended.\n\n### Add decorators to your Lambda Handler\n\nThe decorators defined within this package are:\n\n- GET, POST, PUT, DELETE, ANY are explicitly required for every handler and need to be defined with a custom path for your REST Endpoint.\n- timeout will accept an integer value that will be transformed to duration in terms of seconds for a Lambda Function.\n- memory_size will accept an integer value to specify the memory that will be assigned to each instance of your Lambda Function.\n- name and description assign a custom string value passed as parameter to your Lambda Function's name and description.\n- runtime, role, vpc. Each decorator receives a name string as identifier for a custom value defined for your stack using the [calra-cdk](https://pypi.org/project/calra-cdk/) module.\n- environment, layer and security_group decorators can receive multi arguments or a list with the names of custom environment/layers/security_groups defined for your stack using the [calra-cdk](https://pypi.org/project/calra-cdk/) module.\n\n```python\n    from calra_lambda import *\n    import json\n\n    @GET('/dogs')\n    @runtime('python3.11')\n    @name('LBD-DOGS-GET')\n    @memory_size(256)\n    def lambda_handler(event, context):\n        response = {\n            'statusCode': 200,\n            'body': json.dumps({\n                'message': 'Hello World from /dogs!'\n            })\n        }\n        return response\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 CDK Ast Lambda Rest-API (Calra)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "CDK Ast Lambda Rest Api - Lambda Package",
    "version": "0.1.0",
    "project_urls": {
        "Bug Reports": "https://github.com/cdk-ast-lambda-rest-api/calra-lambda/issues",
        "Source": "https://github.com/cdk-ast-lambda-rest-api/calra-lambda"
    },
    "split_keywords": [
        "cdk",
        " lambda",
        " aws",
        " api gateway",
        " ast",
        " decorators"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdca19e0dcfdbf320a4b6f151d23bad6aa4bf48dbbea58337215a88b7e19bfdb",
                "md5": "6baa3dc2a7f3f8f93a3185519de32e04",
                "sha256": "631741dc7bc6ed2813a12a11c9c58f71f3fabf6d324360a07e3b201bdb6a7098"
            },
            "downloads": -1,
            "filename": "calra_lambda-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6baa3dc2a7f3f8f93a3185519de32e04",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4470,
            "upload_time": "2024-05-14T00:18:00",
            "upload_time_iso_8601": "2024-05-14T00:18:00.069575Z",
            "url": "https://files.pythonhosted.org/packages/bd/ca/19e0dcfdbf320a4b6f151d23bad6aa4bf48dbbea58337215a88b7e19bfdb/calra_lambda-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-14 00:18:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cdk-ast-lambda-rest-api",
    "github_project": "calra-lambda",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "calra-lambda"
}
        
Elapsed time: 0.41453s