{ "info": { "author": "Nathan Reynolds", "author_email": "email@nreynolds.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: Software Development" ], "description": "Custom Resource (AWS)\n=====================\n\nImplement `custom AWS CloudFormation resources`_ with Python Lambda functions.\n\nThis helps you reference non-AWS resources within CloudFormation - for instance,\nlet\u2019s get a StatusCake alert in our stack:\n\n.. code:: yaml\n\n Type: Custom::StatusCakeTest\n Version: 1.0\n Properties:\n WebsiteName: vitalwebsite.com\n WebsiteURL: http://vitalwebsite.com\n CheckRate: 300\n TestType: HTTP\n\n(Implementation left as an exercise for the reader)\n\nSee also\n--------\n\n- Sample code in the ``examples`` directory.\n- `AWS docs`_\n\nLambda Handler\n--------------\n\nHere\u2019s a simple resource:\n\n.. code:: python\n\n from custom_resource import BaseHandler\n\n class Handler(BaseHandler):\n def create(self, event, context):\n return \"CreatedId\", {\"AndSome\": \"MetaData\"}\n\n def update(self, event, context):\n return \"UpdatedId\", {\"AndSome\": \"MetaData\"}\n\n def delete(self, event, context):\n return \"DeletedId\", {\"AndSome\": \"MetaData\"}\n\n handler = Handler()\n\nWe extend the ``BaseHandler`` class, and implement ``create``,\n``update`` and ``delete`` methods. All of these methods are required.\n\nThe methods must either:\n\n- Return a string representing a resource ID. This can be used within\n your CFN template via the `Ref function`_.\n- Return a resource ID string, and a dict containing strings for keys\n and values. These key/value pairs can be used with the `GetAtt\n function`_.\n- Return a ``custom_resource.Success`` or ``custom_resource.Failed``\n object.\n- Return a ``custom_resource.Defer`` object, signifying you\u2019ll process\n this asynchronously. See `async responses`_ below.\n- Raise an exception.\n\n``BaseHandler`` will respond to CloudFormation unless ``Defer`` is\nreturned.\n\nAsync responses\n----------------\n\nYour ``Handler`` method can return ``Defer`` to signal asynchronous\nprocessing.\n\nTo later respond, you need a copy of the original ``event`` object. This\nwill be passed to the ``Responder`` class, e.g:\n\n.. code:: python\n\n with Responder(event) as responder:\n responder.success(physical_resource_id=\"123\", data={\"Meta\": \"Data\"})\n # or\n responder.failure(physical_resource_id=\"456\", reason=\"Something went wrong\")\n\nUsing ``with``, your resource will always respond to CloudFormation even\non exception - ensuring your stack doesn\u2019t stall and eventually timeout.\n\n.. _custom AWS CloudFormation resources: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html\n.. _Ref function: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html\n.. _GetAtt function: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html\n.. _async responses: #async-responses\n.. _AWS docs: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nathforge/custom_resource", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "custom_resource", "package_url": "https://pypi.org/project/custom_resource/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/custom_resource/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/nathforge/custom_resource" }, "release_url": "https://pypi.org/project/custom_resource/0.1.9/", "requires_dist": null, "requires_python": null, "summary": "Implement custom AWS CloudFormation resources with Python Lambda functions.", "version": "0.1.9" }, "last_serial": 2468527, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "bebe4d0016feb06cdb0b91713dc75385", "sha256": "3add3e2478158933a6722fa940829c9f44a60a6e264470dcfe6bb669e464b0ef" }, "downloads": -1, "filename": "custom_resource-0.1.3.tar.gz", "has_sig": false, "md5_digest": "bebe4d0016feb06cdb0b91713dc75385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4984, "upload_time": "2016-11-10T16:54:34", "url": "https://files.pythonhosted.org/packages/f3/0b/eae7771d6dae67befe5db3861020a9864a8c3660efc91fce126e95853954/custom_resource-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0b5f207911c9ad09497b3a34888dab80", "sha256": "8500c928e5ef0e63dc8480a2113dd941e5920d9c73152fb9229e25917db5d809" }, "downloads": -1, "filename": "custom_resource-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0b5f207911c9ad09497b3a34888dab80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5124, "upload_time": "2016-11-11T09:36:53", "url": "https://files.pythonhosted.org/packages/72/30/c6500a5befd50554f845526857094d07b492426a4806bcb1bc73c8ce95a9/custom_resource-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "9e36e6fe6e8e87607408fb413a0f9fcf", "sha256": "d5c8397d4744ee6a5285656a4fd313fc794e4935e94f0f54fc6624c8599ca278" }, "downloads": -1, "filename": "custom_resource-0.1.5.tar.gz", "has_sig": false, "md5_digest": "9e36e6fe6e8e87607408fb413a0f9fcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5160, "upload_time": "2016-11-11T09:37:41", "url": "https://files.pythonhosted.org/packages/79/89/9ff3c4d0af684130ea01be021234477e1fa4530bb0e46099e98c4817eae1/custom_resource-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "6d9d8af082b89e4eb2b4b745a731c7a3", "sha256": "0dc614ffc535e242f5e29bae51941d9dbca52cac3073d08a4e67af76bb8ef4d0" }, "downloads": -1, "filename": "custom_resource-0.1.6.tar.gz", "has_sig": false, "md5_digest": "6d9d8af082b89e4eb2b4b745a731c7a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5196, "upload_time": "2016-11-16T13:13:17", "url": "https://files.pythonhosted.org/packages/b3/93/03b8caaf74fdeb632cefea0edbdc1c0b68a406d5df0e315831bb5868abf9/custom_resource-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "0b061220eeedada8a4aa43971d0c8eda", "sha256": "f2ece279c458e67f9916a06ce4408dba5f6948db16af2989b29d666b817990d5" }, "downloads": -1, "filename": "custom_resource-0.1.7.tar.gz", "has_sig": false, "md5_digest": "0b061220eeedada8a4aa43971d0c8eda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5196, "upload_time": "2016-11-17T19:34:52", "url": "https://files.pythonhosted.org/packages/a3/10/07dd4cccd948329935e591de569a0836cbfa4baa5f8ff0469b884e74f996/custom_resource-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "398c6f693c7f8d7dc3b47435ea592b43", "sha256": "9d6b9c5a1d8f8e7fee64faed7306a9ba63b8ac1d4092840eff29612ff4887013" }, "downloads": -1, "filename": "custom_resource-0.1.8.tar.gz", "has_sig": false, "md5_digest": "398c6f693c7f8d7dc3b47435ea592b43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5194, "upload_time": "2016-11-18T09:45:41", "url": "https://files.pythonhosted.org/packages/e1/73/d734dd200456d482c99518d77c3717594e487343f3d7d42f21fc83d78ac2/custom_resource-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "f9fa06dbb14a8022e15a8da7c8da9099", "sha256": "943b2d4efba2a76a3eeaf970e98807310084f7025db58e3019e6de1cc1504fd4" }, "downloads": -1, "filename": "custom_resource-0.1.9.tar.gz", "has_sig": false, "md5_digest": "f9fa06dbb14a8022e15a8da7c8da9099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5170, "upload_time": "2016-11-18T13:42:58", "url": "https://files.pythonhosted.org/packages/a8/d2/55787a4308ac957d7fecb80870399c2cf44de6956114f066ff654a8d099e/custom_resource-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9fa06dbb14a8022e15a8da7c8da9099", "sha256": "943b2d4efba2a76a3eeaf970e98807310084f7025db58e3019e6de1cc1504fd4" }, "downloads": -1, "filename": "custom_resource-0.1.9.tar.gz", "has_sig": false, "md5_digest": "f9fa06dbb14a8022e15a8da7c8da9099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5170, "upload_time": "2016-11-18T13:42:58", "url": "https://files.pythonhosted.org/packages/a8/d2/55787a4308ac957d7fecb80870399c2cf44de6956114f066ff654a8d099e/custom_resource-0.1.9.tar.gz" } ] }