{ "info": { "author": "Adam Johnson", "author_email": "adamjohnson@timeout.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "========================\n``cfn-resource-timeout``\n========================\n\nThis project is a decorator and validation system that takes the\ndrudgery out of writing custom resources. You still have access to the\ncontext and event as normal, but the decorator handles serializing your\nresponse and communicating results to CloudFormation.\n\nSee `cfn-lambda `__ from\nAndrew Templeton if you're looking to write your custom resources in\nNode.js.\n\nUsage\n-----\n\n1. Copy ``cfn_resource.py`` into the directory of your lambda function\n ``handler.py``, which can be done by installing with ``pip``.\n2. Use the ``cfn_resource.Resource`` event decorators to decorate your\n handler like in ``example.py``\n3. Zip up the contents and upload to Lambda\n\nOnce the function is up, copy its ARN and use it as the ServiceToken for\nyour `custom\nresource `__.\nFor more on the requests you may receive, see `this\ndocument `__\n\n.. code-block:: json\n\n {\n \"AWSTemplateFormatVersion\": \"2010-09-09\",\n \"Resources\": {\n \"FakeThing\": {\n \"Type\": \"Custom::MyResource\",\n \"Properties\": {\n \"ServiceToken\": \"arn:aws:lambda:SOME-REGION:ACCOUNT:function:FunctionName\",\n \"OtherThing\": \"foobar\",\n \"AnotherThing\": 2\n }\n }\n }\n }\n\nFor more on how custom resources work, see the `AWS\ndocs `__\n\nCode Sample\n-----------\n\nFor this example, you need to have your handler in Lambda set as\n``filename.handler`` where filename has the below contents.\n\n.. code-block:: python\n\n import cfn_resource\n\n # set `handler` as the entry point for Lambda\n handler = cfn_resource.Resource()\n\n @handler.create\n def create_thing(event, context):\n # do some stuff\n return {\"PhysicalResourceId\": \"arn:aws:fake:myID\"}\n\n @handler.update\n def update_thing(event, context):\n # do some stuff\n return {\"PhysicalResourceId\": \"arn:aws:fake:myID\"}\n\n @handler.delete\n def delete_thing(event, context):\n # do some stuff\n return {\"PhysicalResourceId\": \"arn:aws:fake:myID\"}\n\nRunning Tests\n-------------\n\nInstall and run `tox `_:\n\n.. code-block:: sh\n\n tox\n\nThe tests use ``mock`` and ``pytest`` and will give you a terminal\ncoverage report. Currently the tests cover ~90% of the (very small)\ncodebase.\n\nLicense\n-------\n\nThis code is released under the MIT software license, see LICENSE.txt\nfor details. No warranty of any kind is included, and the copyright\nnotice must be included in redistributions.\n\n\n=======\nHistory\n=======\n\nPending Release\n---------------\n\n* (Insert new release notes below this line)\n\n1.2.0 (2017-05-03)\n------------------\n\n* Move from ``urllib`` to ``requests`` to fix some encoding errors on Python 3\n\n1.1.0 (2017-04-27)\n------------------\n\n* Added Python 3 compatibility\n\n1.0.0 (2017-03-22)\n------------------\n\n* Forked from RyanSB to Time Out.\n* Allow rescheduling - by raising the new built-in ``NoResponse`` exception, a\n resource can avoid sending any messing to CloudFormation. This is to support\n Lambda functions that take >300 seconds to execute and thus reschedule\n themselves.\n\n0.2.2 (2016-01-29)\n------------------\n\n* Last version `by RyanSB `_.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/timeoutdigital/cfn-resource-timeout", "keywords": "cloudformation aws cloud custom resource amazon", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cfn-resource-timeout", "package_url": "https://pypi.org/project/cfn-resource-timeout/", "platform": "", "project_url": "https://pypi.org/project/cfn-resource-timeout/", "project_urls": { "Homepage": "https://github.com/timeoutdigital/cfn-resource-timeout" }, "release_url": "https://pypi.org/project/cfn-resource-timeout/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Wrapper decorators for building CloudFormation custom resources", "version": "1.2.0" }, "last_serial": 4374380, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9aeab4ef6088a8268ce3a3ce7c26c9fb", "sha256": "262dca109560d0170dd612484570064fb842b166550b0a53f3b6f5ffb30fe6c1" }, "downloads": -1, "filename": "cfn_resource_timeout-1.0.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "9aeab4ef6088a8268ce3a3ce7c26c9fb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6502, "upload_time": "2017-03-22T11:34:25", "url": "https://files.pythonhosted.org/packages/1a/ab/dae80443a2688e10ae7caded732a62db831526f4fb9fe3a7559e777e65f2/cfn_resource_timeout-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3feda04005eac6e4525fc76741decc55", "sha256": "15348a935367de3ba4590897a83ce5deea368d8508f7375dd5e9440178f0d8d9" }, "downloads": -1, "filename": "cfn-resource-timeout-1.0.0.tar.gz", "has_sig": true, "md5_digest": "3feda04005eac6e4525fc76741decc55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4988, "upload_time": "2017-03-22T11:34:22", "url": "https://files.pythonhosted.org/packages/50/0f/1d22bfe789dab76812a5fb69afbba2df424c03a02597ec6d3d050d62fd1b/cfn-resource-timeout-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "e0f578cfff3b8542ccd23f48b8504c79", "sha256": "3dc7b866d198353ebe8ee4968157e211f6bffdc54640e9a5194edcb7dd6eaa0e" }, "downloads": -1, "filename": "cfn_resource_timeout-1.1.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e0f578cfff3b8542ccd23f48b8504c79", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6630, "upload_time": "2017-04-27T16:50:15", "url": "https://files.pythonhosted.org/packages/c4/5b/69087f2de47d48f5e140a5165ed2f1ebf06a343cae250b308c1a89b38cc9/cfn_resource_timeout-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c3bea20f5d39ce769985019d8e533f3", "sha256": "6d2340b3db73ad322104070313299b006ba0b1ca361ef5e352cc8e1860110d99" }, "downloads": -1, "filename": "cfn-resource-timeout-1.1.0.tar.gz", "has_sig": true, "md5_digest": "6c3bea20f5d39ce769985019d8e533f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5107, "upload_time": "2017-04-27T16:50:13", "url": "https://files.pythonhosted.org/packages/96/7d/8001c56bf9b56308fbdf60f8bb29f66fb4f0e0cba3a58f97a39d58ca4f56/cfn-resource-timeout-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "0777c8089b42719aa44370be73ce3ef1", "sha256": "940288f76e5486432a75457d6f76885ada87ee1b8bec17c87117d8ce936bd25d" }, "downloads": -1, "filename": "cfn_resource_timeout-1.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0777c8089b42719aa44370be73ce3ef1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6685, "upload_time": "2017-05-03T12:08:17", "url": "https://files.pythonhosted.org/packages/39/13/e3277073a58252a9cc153e4474c1d693a6ea9ea8120198ed465a245e4ca0/cfn_resource_timeout-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "339894e4c35d926683c88bd89726a9ab", "sha256": "40a28c845fa956c3d280d5de62e7a2fe1beb345aa4be40e4f27df1eaa6de38f0" }, "downloads": -1, "filename": "cfn-resource-timeout-1.2.0.tar.gz", "has_sig": true, "md5_digest": "339894e4c35d926683c88bd89726a9ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5132, "upload_time": "2017-05-03T12:08:15", "url": "https://files.pythonhosted.org/packages/8a/93/b316acc91e040ccc776e2881748de71d5c0d77197a73ab50877706109617/cfn-resource-timeout-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0777c8089b42719aa44370be73ce3ef1", "sha256": "940288f76e5486432a75457d6f76885ada87ee1b8bec17c87117d8ce936bd25d" }, "downloads": -1, "filename": "cfn_resource_timeout-1.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0777c8089b42719aa44370be73ce3ef1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6685, "upload_time": "2017-05-03T12:08:17", "url": "https://files.pythonhosted.org/packages/39/13/e3277073a58252a9cc153e4474c1d693a6ea9ea8120198ed465a245e4ca0/cfn_resource_timeout-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "339894e4c35d926683c88bd89726a9ab", "sha256": "40a28c845fa956c3d280d5de62e7a2fe1beb345aa4be40e4f27df1eaa6de38f0" }, "downloads": -1, "filename": "cfn-resource-timeout-1.2.0.tar.gz", "has_sig": true, "md5_digest": "339894e4c35d926683c88bd89726a9ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5132, "upload_time": "2017-05-03T12:08:15", "url": "https://files.pythonhosted.org/packages/8a/93/b316acc91e040ccc776e2881748de71d5c0d77197a73ab50877706109617/cfn-resource-timeout-1.2.0.tar.gz" } ] }