{"id":16398984,"url":"https://github.com/iliapolo/aws-cdk-lambdecor","last_synced_at":"2025-07-05T17:05:31.168Z","repository":{"id":71286724,"uuid":"290865230","full_name":"iliapolo/aws-cdk-lambdecor","owner":"iliapolo","description":"Native python functions as AWS CDK Custom Resources","archived":false,"fork":false,"pushed_at":"2020-08-30T09:58:10.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T09:23:21.794Z","etag":null,"topics":["aws-cdk","aws-lambda-python","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iliapolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-27T19:36:31.000Z","updated_at":"2020-08-30T10:07:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"a36371f4-11c6-461a-86ea-dfafd52549a7","html_url":"https://github.com/iliapolo/aws-cdk-lambdecor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliapolo%2Faws-cdk-lambdecor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliapolo%2Faws-cdk-lambdecor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliapolo%2Faws-cdk-lambdecor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliapolo%2Faws-cdk-lambdecor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iliapolo","download_url":"https://codeload.github.com/iliapolo/aws-cdk-lambdecor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240298398,"owners_count":19779280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cdk","aws-lambda-python","python"],"created_at":"2024-10-11T05:14:28.942Z","updated_at":"2025-02-23T09:42:33.373Z","avatar_url":"https://github.com/iliapolo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI Version](http://img.shields.io/pypi/v/aws-cdk-lambdecor.svg)](https://pypi.org/project/aws-cdk-lambdecor/)\n[![Is Wheel](https://img.shields.io/pypi/wheel/aws-cdk-lambdecor.svg?style=flat)](https://pypi.org/project/aws-cdk-lambdecor/)\n[![PyCI release](https://img.shields.io/badge/pyci-release-brightgreen.svg)](https://github.com/iliapolo/aws-cdk-lambdecor)\n![Build Status](https://github.com/iliapolo/aws-cdk-lambdecor/workflows/master/badge.svg)\n\n# aws-cdk-lambdecor\n\nTransform native python function into [AWS CDK Custom Resources](https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html).\n\n```python\nfrom aws_cdk_lambdecor import aws_lambda\nfrom aws_cdk import core as cdk\n\napp = cdk.App()\nstack = cdk.Stack(app, 'HelloLambdecor')\n\n@aws_lambda(stack)\ndef greet():\n  return 'hello'\n\n# invoke the function just like a regular function\ngreeting = greet()\n\n# return value is a token that can be used later on\ncdk.CfnOutput(stack, 'Greeting', value=greeting)\n\napp.synth()\n```\n\nYou can also use tokens:\n\n```python\nfrom aws_cdk_lambdecor import aws_lambda\nfrom aws_cdk import core as cdk\nfrom aws_cdk import s3\nfrom aws_cdk import aws_apigateway as apigateway\n\napp = cdk.App()\nstack = cdk.Stack(app, 'HelloLambdecor')\n\n@aws_lambda(stack)\ndef ping(url):\n  http = urllib3.PoolManager()\n  r = http.request('GET', url)\n  return r.status\n\napi = apigateway.LambdaRestApi(...)\nstatus = ping(api.url)\n\ncdk.CfnOutput(stack, 'Status', value=status)\n\napp.synth()\n```\n\n## Runtime\n\nThe Custom Resource is created with the [Python3.6 Lambda Runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\n\n### Imports\n\nThe following modules are pre-imported into the lambda environment:\n\n- `json`\n- `urllib3`\n\nTo use any other module, you would need to do an inline import.\n\n## Install\n\n`pip install aws-cdk-lambdecor`\n\n## Possible Future Work\n\n- Support customizing all properties of the CDK Lambda Function (i.e runtime, memory, environment...)\n- Pre-import additional common libraries.\n- Implicit CDK scope creation to support CDK applications consisting of just these lambda functions.\n- Implicit creation of Stack output.\n- Command line invocation of function that runs `cdk deploy` and parses the stack output. (i.e `result=$(aws-cdk-lamdecor invoke func.py)`)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiapolo%2Faws-cdk-lambdecor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filiapolo%2Faws-cdk-lambdecor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiapolo%2Faws-cdk-lambdecor/lists"}