{ "info": { "author": "Drew J. Sonne", "author_email": "drew.sonne@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "|PyPI version|\n\n|Code Issues|\n\n|codecov|\n\n|Build Status|\n\ncfnjsontoyaml\n=============\n\nConvert JSON CloudFormation templates to the new YAML syntax. This\nincludes converting all ``Fn::*`` and ``Ref`` JSON functions to ``!*``\nyaml node type functions.\n\nIn addition, cfnjsontoyaml tries to make a best guess at when\n``Fn::Join`` functions should automatically be converted to ``!Sub``.\n\nConvert Long JSON to compact YAML\n---------------------------------\n\nThis utility not only converts from JSON to yaml, it will use the new\nshort yaml syntax, and attempt to convert ``Fn::Join`` to ``!Sub``,\nresulting in shorter, more compact syntax.\n\nFor example, and IAM role can be converted from 127 lines of JSON\ncloudformation to 30 lines of yaml.\n\n.. figure:: docs/images/diagram.png\n :alt: docs/images/diagram.png\n\n docs/images/diagram.png\n\nUsage\n-----\n\n``cfn-json-to-yaml`` reads either from standard in, or takes the first\nargument as the template to ingest and prints the yaml converted\ntemplate to stdout.\n\n::\n\n $ pip install cfnjsontoyaml\n $ cat my_template.json | cfn-json-to-yaml\n\nExamples\n--------\n\nAPIGateway Method with lambda proxy\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn some cases, we can halve the number of lines, while still maintaining\nreadability. Here, we convert 48 lines of JSON to 19 lines of YAML. ####\nJSON\n\n::\n\n {\n \"Resources\": {\n \"MappingReferenceMethod\": {\n \"Type\": \"AWS::ApiGateway::Method\",\n \"DependsOn\": [\n \"LambdaInvokePermissionMappingReference\"\n ],\n \"Properties\": {\n \"RestApiId\": {\n \"Ref\": \"RestApi\"\n },\n \"ResourceId\": {\n \"Ref\": \"MappingReferenceResource\"\n },\n \"HttpMethod\": \"POST\",\n \"AuthorizationType\": \"NONE\",\n \"ApiKeyRequired\": true,\n \"RequestParameters\": {\n \"method.request.header.x-api-key\": true\n },\n \"Integration\": {\n \"Type\": \"AWS_PROXY\",\n \"Uri\": {\n \"Fn::Join\": [\n \"\",\n [\n \"arn:aws:apigateway:\",\n {\n \"Ref\": \"AWS::Region\"\n },\n \":lambda:path/2015-03-31/functions/\",\n {\n \"Fn::GetAtt\": [\n \"LambdaFunctionMappingReference\",\n \"Arn\"\n ]\n },\n \"/invocations\"\n ]\n ]\n },\n \"IntegrationHttpMethod\": \"POST\",\n \"PassthroughBehavior\": \"when_no_templates\"\n }\n }\n }\n }\n }\n\nYAML\n^^^^\n\n::\n\n ---\n Resources:\n MappingReferenceMethod:\n Type: AWS::ApiGateway::Method\n Properties:\n ApiKeyRequired: true\n AuthorizationType: NONE\n HttpMethod: POST\n Integration:\n IntegrationHttpMethod: POST\n PassthroughBehavior: when_no_templates\n Type: AWS_PROXY\n Uri: !Sub \"arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFunctionMappingReference.Arn}/invocations\"\n RequestParameters:\n method.request.header.x-api-key: true\n ResourceId: !Ref \"MappingReferenceResource\"\n RestApiId: !Ref \"RestApi\"\n DependsOn:\n - LambdaInvokePermissionMappingReference\n\nProblems\n--------\n\nThere are a wide range of combinations for functions in cloudformation.\nIf you come across a template which does not render correctly, please\ntry and isolate the fragment of json which is causing issues, and create\nan `issue in\ngithub `__ .\n\nIf you'd like to be a bit more helpful, you can fork the repository,\ncreate a branch, and add a json/yaml snippet to\nhttps://github.com/drewsonne/cfn-json-to-yaml/tree/master/tests/resources/fragments\nwith the next sequential number. The smaller the json/yaml snippet you\ncan provide the quicker I can fix it. :-)\n\n.. |PyPI version| image:: https://badge.fury.io/py/cfnjsontoyaml.svg\n :target: https://badge.fury.io/py/cfnjsontoyaml\n.. |Code Issues| image:: https://www.quantifiedcode.com/api/v1/project/b6d9757c91b64831ba12fd7cf53332de/badge.svg\n :target: https://www.quantifiedcode.com/app/project/b6d9757c91b64831ba12fd7cf53332de\n.. |codecov| image:: https://codecov.io/gh/drewsonne/cfn-json-to-yaml/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/drewsonne/cfn-json-to-yaml\n.. |Build Status| image:: https://travis-ci.org/drewsonne/cfn-json-to-yaml.svg?branch=master\n :target: https://travis-ci.org/drewsonne/cfn-json-to-yaml\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/drewsonne/cfn-json-to-yaml/archive/v.1.0.5.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/drewsonne/cfn-json-to-yaml", "keywords": "", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "cfnjsontoyaml", "package_url": "https://pypi.org/project/cfnjsontoyaml/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cfnjsontoyaml/", "project_urls": { "Download": "https://github.com/drewsonne/cfn-json-to-yaml/archive/v.1.0.5.zip", "Homepage": "https://github.com/drewsonne/cfn-json-to-yaml" }, "release_url": "https://pypi.org/project/cfnjsontoyaml/1.0.5/", "requires_dist": [ "pyyaml", "six" ], "requires_python": "", "summary": "", "version": "1.0.5" }, "last_serial": 2733077, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "11f8f037d3452467de20b9a76e0bfb6b", "sha256": "dea077a9f052b6b4e6d6dc1d2eae6d43e5d97b93f5831bc9ad301016cfd1622b" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11f8f037d3452467de20b9a76e0bfb6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5019, "upload_time": "2017-03-20T22:27:33", "url": "https://files.pythonhosted.org/packages/6f/55/a802445f7b1e8727032ead00045758f2f2c46f02296d399b24bcd60eba15/cfnjsontoyaml-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "820f202a52fd3301041efe09c51148c2", "sha256": "e36b030f7482caed8475b1f6f6213c0b17e6005a0c5770e06c263b0aac8d6879" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.0.tar.gz", "has_sig": false, "md5_digest": "820f202a52fd3301041efe09c51148c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3289, "upload_time": "2017-03-20T22:27:35", "url": "https://files.pythonhosted.org/packages/03/f7/c9c2a49b1df2ba673f951275f2146e6c8be8926841cdd9ffb519ab0876ea/cfnjsontoyaml-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "fa4b5e7ddd32f78165e111981fde57c6", "sha256": "77b33667be426cbe88754722c2f9b9b3092c15cee5453bc5a778a3e3b72ea50a" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fa4b5e7ddd32f78165e111981fde57c6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5019, "upload_time": "2017-03-20T22:30:36", "url": "https://files.pythonhosted.org/packages/90/aa/14ea063549d6ca21afda97c8e4fd877ae468c16ef70f771a44bb2ed88f1b/cfnjsontoyaml-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a4c48c52e2969462bbc347007a70475", "sha256": "484f66f813f747fb49bf2a97ccea2a2bb0a6b2a8cc9b633fcf11da03e27bbbfa" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.1.tar.gz", "has_sig": false, "md5_digest": "3a4c48c52e2969462bbc347007a70475", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3320, "upload_time": "2017-03-20T22:30:39", "url": "https://files.pythonhosted.org/packages/97/22/e397958019daadab5b06c60e4e9e527e1eabb6a75255f5a5f22353eac673/cfnjsontoyaml-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "93b59c4419d45e09251fad8f57c968a7", "sha256": "5c4220c0afe01d282b0aa36613d11d2ff3939842bded23071be2dceaa9d269c1" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "93b59c4419d45e09251fad8f57c968a7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15583, "upload_time": "2017-03-21T14:20:00", "url": "https://files.pythonhosted.org/packages/ab/2b/bf661c6863140326aa7746988beb9545bddc7d5aee6cdd42cb6592ed4fa6/cfnjsontoyaml-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f0898894b5e3b13aff8cbb1a70b90c89", "sha256": "b770f2d7412db9b5ee91acc2419ef638405eade4bb195f80a44c4ba2039b211c" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.3.tar.gz", "has_sig": false, "md5_digest": "f0898894b5e3b13aff8cbb1a70b90c89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6575, "upload_time": "2017-03-21T14:20:01", "url": "https://files.pythonhosted.org/packages/ad/a7/7b355e6d7ed5d7093019e6c10d6288c8048c301d63bf4e21963918000547/cfnjsontoyaml-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "dcda41a3499f3f549131d69fc3b49957", "sha256": "239e876a58c6a961ad1bbf5d06c7a88a05f7a325b14a54b8ef8928785bd96a2e" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcda41a3499f3f549131d69fc3b49957", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16413, "upload_time": "2017-03-27T09:50:54", "url": "https://files.pythonhosted.org/packages/45/46/2e50bc2586a631083ff235833f1f6afcfd05c8e08f974ffa0861a8e376e6/cfnjsontoyaml-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4f5e417ce732d1360dc1e29c9e3441e", "sha256": "ad2c67f196968f010eb065986c07b155611339e40b03f41d90a22243e1b8330b" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.5.tar.gz", "has_sig": false, "md5_digest": "d4f5e417ce732d1360dc1e29c9e3441e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8579, "upload_time": "2017-03-27T09:50:56", "url": "https://files.pythonhosted.org/packages/89/b1/d0fc3a92f86eb91c18b42be95c9036ac1e8d4cb4a33302ec4fa102c6d605/cfnjsontoyaml-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcda41a3499f3f549131d69fc3b49957", "sha256": "239e876a58c6a961ad1bbf5d06c7a88a05f7a325b14a54b8ef8928785bd96a2e" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcda41a3499f3f549131d69fc3b49957", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16413, "upload_time": "2017-03-27T09:50:54", "url": "https://files.pythonhosted.org/packages/45/46/2e50bc2586a631083ff235833f1f6afcfd05c8e08f974ffa0861a8e376e6/cfnjsontoyaml-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4f5e417ce732d1360dc1e29c9e3441e", "sha256": "ad2c67f196968f010eb065986c07b155611339e40b03f41d90a22243e1b8330b" }, "downloads": -1, "filename": "cfnjsontoyaml-1.0.5.tar.gz", "has_sig": false, "md5_digest": "d4f5e417ce732d1360dc1e29c9e3441e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8579, "upload_time": "2017-03-27T09:50:56", "url": "https://files.pythonhosted.org/packages/89/b1/d0fc3a92f86eb91c18b42be95c9036ac1e8d4cb4a33302ec4fa102c6d605/cfnjsontoyaml-1.0.5.tar.gz" } ] }