{ "info": { "author": "Kim Johansson", "author_email": "hagbarddenstore@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "Cfn\n===\n\nA Python script to generate and manage AWS CloudFormation stacks based\non YAML inputs.\n\nDefine stacks and their templates in YAML and make use of Jinja2 in the\ntemplate definition to generate a finished JSON CloudFormation template.\n\nStacks\n------\n\nA stack defines the static values and dynamic parameters that are put\ninto the template to generate a usable CloudFormation template.\n\nYou can define multiple stacks that use the same template by using a\ndifferent region or environment.\n\nIn the examples below I use a single template to define a CloudFormation\nstack for the regions ``eu-west-1`` and ``eu-central-1``. The example\ncreates one subnet per availability zone, something that differs between\nthe two regions. So, instead of limiting ourself to just using two\navailability zones, we use a bit of Jinja2 templating and simply\ngenerate the subnets from a list.\n\nTemplates\n---------\n\nA template is a YAML file that is pre-processed by Jinja2 before being\nturned into JSON. It gets values from the stack and is then generated to\nprovide a finished stack that can be used by CloudFormation.\n\nCreate your first stack and template\n------------------------------------\n\nFirst, create two directories, ``stacks`` and ``templates``. These\nfolders will contain your stacks and your templates.\n\nThen, create two stacks, one for region ``eu-west-1`` and one for\n``eu-central-1``. You can copy paste the code below.\n\n::\n\n # stacks/example.eu-west-1.yml\n ---\n name: Example\n values:\n azs:\n - eu-west-1a\n - eu-west-1b\n - eu-west-1c\n\n::\n\n # stacks/example.eu-central-1.yml\n ---\n name: Example\n values:\n azs:\n - eu-central-1a\n - eu-central-1b\n\nNext, create a template that looks like this:\n\n::\n\n # templates/example.yml\n ---\n AWSTemplateFormatVersion: \"2010-09-09\"\n\n Description: Example stack template\n\n Resources:\n {% for az in azs %}\n {{ \"Subnet%s:\" | format(az[-1].upper()) }}\n Type: AWS::EC2::Subnet\n Properties:\n AvailabilityZone: {{ az }}\n # Other properties are not present, because the example\n # would become too long...\n {% endfor %}\n\nThat's it! Now it's time to generate the CloudFormation files. Run\n``cfn --region eu-west-1 generate example`` and\n``cfn --region eu-central-1 generate example``. You should have a new\nfolder ``output`` which contains two files, ``example.eu-west-1.json``\nand ``example.eu-central-1.json``. These are the ready to use\nCloudFormation templates.\n\nThe generated CloudFormation stack template for\n``stacks/example.eu-west-1.yml`` would look something like this:\n\n::\n\n {\n \"AWSTemplateFormatVersion\": \"2010-09-09\",\n \"Description\": \"Example stack template\",\n \"Resources\": {\n \"SubnetA\": {\n \"Type\": \"AWS::EC2::Subnet\",\n \"Properties\": {\n \"AvailabilityZone\": \"eu-west-1a\"\n }\n },\n \"SubnetB\": {\n \"Type\": \"AWS::EC2::Subnet\",\n \"Properties\": {\n \"AvailabilityZone\": \"eu-west-1b\"\n }\n },\n \"SubnetC\": {\n \"Type\": \"AWS::EC2::Subnet\",\n \"Properties\": {\n \"AvailabilityZone\": \"eu-west-1c\"\n }\n }\n }\n }\n\nYou can validate these files with the ``aws-cli`` tool by running\n``aws cloudformation validate-template --template-body file://output/example.eu-central-1.json``.\n\nTo create the stack using the cfn tool, run\n``cfn --region eu-west-1 create example``.\n\nIf you've made changes to the stack and wish to update, run\n``cfn --region eu-west-1 update example``.\n\nRun ``cfn --region eu-west-1 delete example`` to delete an existing\nstack created by the cfn tool.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hagbarddenstore/cfn", "keywords": "aws cfn cloudformation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cfn", "package_url": "https://pypi.org/project/cfn/", "platform": "", "project_url": "https://pypi.org/project/cfn/", "project_urls": { "Homepage": "https://github.com/hagbarddenstore/cfn" }, "release_url": "https://pypi.org/project/cfn/0.0.11/", "requires_dist": null, "requires_python": "", "summary": "Small script to manipulate AWS CloudFormation stacks", "version": "0.0.11" }, "last_serial": 2367027, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ca38bf061099e2161176d59980801d4c", "sha256": "80693156aa9fca4cc30bd3e71592affbe34016fd98cbdbbafcc0ddeccb99bc03" }, "downloads": -1, "filename": "cfn-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ca38bf061099e2161176d59980801d4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1422, "upload_time": "2016-09-15T07:13:00", "url": "https://files.pythonhosted.org/packages/1a/b2/aa8a13459e67b6085feab69bddd2c6102d9217fc71227e4c4f77b17cc1a4/cfn-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "2c603689d43cad4356244d3798334509", "sha256": "2f78dd4bab2b00a07f8730288e00c26f9941dde800f859d6f6e7404e023d982f" }, "downloads": -1, "filename": "cfn-0.0.10.tar.gz", "has_sig": false, "md5_digest": "2c603689d43cad4356244d3798334509", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4840, "upload_time": "2016-09-27T15:29:31", "url": "https://files.pythonhosted.org/packages/9d/c6/3065525126237c36e38484646fc16a47f251dc858a53154f478025319d92/cfn-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "9b622cbd7cb8a0c22f0ec965d87ffe1d", "sha256": "9ea08874ca6879115476fe64bf21c6187990b771bd7aa954db6d5185f6c2ed3f" }, "downloads": -1, "filename": "cfn-0.0.11.tar.gz", "has_sig": false, "md5_digest": "9b622cbd7cb8a0c22f0ec965d87ffe1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4845, "upload_time": "2016-09-27T19:42:42", "url": "https://files.pythonhosted.org/packages/c9/01/b4f3d7206461f8a434e01978761f27be95cb6750270163c4483ad6fb69ae/cfn-0.0.11.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "156d1c9a8b2998b04399446d6aa329b9", "sha256": "9b94126b588fb4cb3c6fc719cedee976b8ab35a536fb4c40b0e1db75912617a6" }, "downloads": -1, "filename": "cfn-0.0.2.tar.gz", "has_sig": false, "md5_digest": "156d1c9a8b2998b04399446d6aa329b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3161, "upload_time": "2016-09-26T16:38:22", "url": "https://files.pythonhosted.org/packages/29/99/f52fbf6b9f6c1dcb43b95528a0c21259aaa14be36e26569b98f0b686c5b4/cfn-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a0aecfb2335a7311ee707843a4fe03f7", "sha256": "17d4240255870a25dba312539485730d7d465d68fbe6052c258afe15f614aa64" }, "downloads": -1, "filename": "cfn-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a0aecfb2335a7311ee707843a4fe03f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4440, "upload_time": "2016-09-26T17:24:21", "url": "https://files.pythonhosted.org/packages/27/2f/3a7154114a442258b07ffbeabc2de5db5a6fe7d052a5af2e674238c3b238/cfn-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "34a507b79c9dad0bc9bad59d0e964f13", "sha256": "d267d88d7d25e20b4a4394f865187d5b4c00304531f305c8d97051ddb4c9352e" }, "downloads": -1, "filename": "cfn-0.0.4.tar.gz", "has_sig": false, "md5_digest": "34a507b79c9dad0bc9bad59d0e964f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4513, "upload_time": "2016-09-26T17:39:21", "url": "https://files.pythonhosted.org/packages/1d/7d/7c2597ba95568e7d63cf3877f641cb4a8223df81bc3592de409e82726408/cfn-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "c2517063c7d990ffc70eab8d2a4ac6c7", "sha256": "ad61b1c066716dd6548cd98d38a1b366d7c4116201d6686a0bf44f8c5db2bc6a" }, "downloads": -1, "filename": "cfn-0.0.5.tar.gz", "has_sig": false, "md5_digest": "c2517063c7d990ffc70eab8d2a4ac6c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4518, "upload_time": "2016-09-26T17:43:55", "url": "https://files.pythonhosted.org/packages/fe/be/954fc70fd01394fd66e06e5b8bc30c3b9d1e7055fff4c857e480435393dc/cfn-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "ee2fb1febc0b7d6da585433582036182", "sha256": "187a4d7bcd8ff6d95734b2880d62b3ea37c5ff53c29e830455e556d41c20246d" }, "downloads": -1, "filename": "cfn-0.0.6.tar.gz", "has_sig": false, "md5_digest": "ee2fb1febc0b7d6da585433582036182", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4530, "upload_time": "2016-09-26T17:50:33", "url": "https://files.pythonhosted.org/packages/80/c0/ed0039ed5461dce45828619e1e13e8fdcfa13301763d829a4834d7c6b0f1/cfn-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "24fd482b7aa5cb1237edcdb010d46a0e", "sha256": "08e9b4dd2f4f9b77b4ee5cf7612d8e60ef82876b356ea7c8713c5081cb0a8e77" }, "downloads": -1, "filename": "cfn-0.0.7.tar.gz", "has_sig": false, "md5_digest": "24fd482b7aa5cb1237edcdb010d46a0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4544, "upload_time": "2016-09-26T17:52:41", "url": "https://files.pythonhosted.org/packages/bb/1a/2ee3202563ac7649db267dec54f8fefd6ac6fe0f0ea433b44f0817fcd58c/cfn-0.0.7.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "381c49f8ad62f9a45dc5e1b778fc27a7", "sha256": "c854825e5c88a7662226fa004463f2c4b570692c4475fe4f16de7ada2e0dc57b" }, "downloads": -1, "filename": "cfn-0.0.9.tar.gz", "has_sig": false, "md5_digest": "381c49f8ad62f9a45dc5e1b778fc27a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4838, "upload_time": "2016-09-26T18:10:34", "url": "https://files.pythonhosted.org/packages/83/f9/ec9ee4f4662a72d2bf711739e80157f540c2edbc0da87e30698390080067/cfn-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9b622cbd7cb8a0c22f0ec965d87ffe1d", "sha256": "9ea08874ca6879115476fe64bf21c6187990b771bd7aa954db6d5185f6c2ed3f" }, "downloads": -1, "filename": "cfn-0.0.11.tar.gz", "has_sig": false, "md5_digest": "9b622cbd7cb8a0c22f0ec965d87ffe1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4845, "upload_time": "2016-09-27T19:42:42", "url": "https://files.pythonhosted.org/packages/c9/01/b4f3d7206461f8a434e01978761f27be95cb6750270163c4483ad6fb69ae/cfn-0.0.11.tar.gz" } ] }