{ "info": { "author": "Patrick McClory, Patrick Pierson", "author_email": "patrick@dualspark.com, patrick.pierson@ionchannel.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Code Generators", "Topic :: Utilities" ], "description": "Cloudformation Environment Generator\n------------------------------------\n|Build Status|\n\n.. |Build Status| image:: https://travis-ci.org/AWSFrederick/cloudformation-environmentbase.svg?branch=master\n :target: https://travis-ci.org/AWSFrederick/cloudformation-environmentbase\n\n|Gitter Chat|\n\n.. |Gitter Chat| image:: https://badges.gitter.im/gitterHQ/gitter.png\n :target: https://gitter.im/cloudformation-environmentbase/Lobby\n\nWhat is Environmentbase?\n------------------------\n\nEnvironmentbase extends\n`troposphere `__, a library\nof wrapper objects for programmatically generating Cloudformation\ntemplates. Environmentbase embraces this model of automation development\nand extends it in several ways:\n\n- provides a configurable base layer of networking resources enabling\n you to focus on services instead of networking\n- provides a small but growing library of functional infrastructure\n patterns encapsulating industry best practices.\n- provides an extension mechanism to develop your own configurable,\n reusable 'patterns' using child-templates.\n\nMoreover the Environmentbase platform allows for a service oriented\ndevelopment model, whereby small teams can build, test and deploy\nindependent infrastructure automation templates, each focused on a\nspecific service or function. These templates can be imported and\nassociated to a 'top-level' (integration) template to centrally deploy\nand manage the full environment. The same template can be deployed in\nany region or AWS account to produce identical environments.\n\n| Out of the box, this will create a VPC that should deploy cleanly into\n any region\n| across the publicly available AWS regions. The VPC network, by\n default, will\n| include:\n\n- A public (/24) and a private subnet (/22) in three different\n Availability Zones\n- A highly available NAT instance per AZ\n- An S3 bucket configured to allow Amazon ELB (within the same region)\n and AWS\n CloudTrail to aggregate logs\n\n| There are a number of configuration options documented within the\n script itself\n| using `docopt `__. An overview of the general\n capabilities and\n| features is as follows:\n\n- This script queries the AWS VPC API to ensure that the AZ's selected\n for\n deployment will allow subnets to be deployed to them (sometimes an\n issue in\n older accounts)\n- Modify the base network CIDR block and subnet size and count via\n parameters\n- Set prefixes for S3 key names for ELB and CloudTrail logging paths\n within the\n created bucket\n\n| Used from the command line, this will generate the network alone, but\n when used\n| as a Python module, it's a powerful building block to help generate\n the basic\n| structures for more complex environments in CloudFormation very\n easily.\n\nPython Usage\n------------\n\n| The Python class EnvironmentBase is designed to be useful from command\n line\n| tools, but has further utility as a base class for more complicated\n| environments. The original aim of this script was to build a reusable\n artifact\n| that could serve as the common networking design for multi-AZ,\n multi-subnet\n| demo environments. As such, the environmentbase.py script contains a\n number of\n| methods that are meant to be used by sub-classes and provide\n abstractions for\n| common workflows and use cases. To use this class, simply add it as a\n dependency\n| in your requirements.txt or setup.py. The following is an example\n showing how to\n| import core envbase components and patterns, including the bastion\n host pattern:\n\n.. code:: python\n\n from environmentbase.networkbase import NetworkBase\n from environmentbase.patterns.bastion import Bastion\n\n class MyEnvClass(NetworkBase):\n '''\n Class creates a VPC, common network components for the environment and a bastion host\n '''\n\n def create_hook(self):\n\n # Do custom troposphere resource creation here\n self.add_child_template(Bastion())\n\n\n def deploy_hook(self):\n\n # Do custom deploy steps here\n\n\n if __name__ == '__main__':\n\n MyEnvClass()\n\nOverriding these two functions allows you to hook into the template\ngeneration and stack creation processes of environmentbase to inject the\nresources and deployment steps for your environment. This create\\_hook()\nwill add a bastion host as a child stack of the environment. See the\n`Development `__ documentation for more detailed\nexamples.\n\nSee `here `__ for more examples of using patterns.\n\n| Documentation within the class takes a modified usage of the\n| `doxygen `__\n| standard by adding a @classarg identifier that indicates that a given\n method\n| utilizes an argument that's passed in via the class constructor along\n with the\n| type and description of that parameter.\n\nGetting Started\n---------------\n\nTo use this script, you must install some requirements (listed\n`here `__)\n\n| We recommend you create a `virtual\n environment `__ to isolate the\n dependencies from the rest of your system, but it is not required.\n| Run the following commands from the root of the environmentbase\n directory to install the dependencies:\n\n.. code:: bash\n\n python setup.py install\n\nTo use the script itself, you can run it directly from the command line:\n\n.. code:: bash\n\n environmentbase --help\n\nYou must have your AWS credentials configured as required by\n`boto `__.\n\nIf you have the AWS CLI, you can run ``aws configure`` to generate the\ncredentials files in the appropriate place. If you have already\nconfigured the AWS CLI, then no further steps are necessary.\n\nYou must ensure that the account you are authenticating with has at\nleast the following permissions:\n\n.. code:: javascript\n\n {\"Statement\": [ {\"Action\": [\"ec2:DescribeAvailabilityZones\",\n \"ec2:DescribeRegions\"], \"Effect\": \"Allow\", \"Resource\": \"*\" }]}\n\nThis is required to perform the VPC lookups.\n\nOnce you have configured your credentials, you can run the generator as\nfollows:\n\n.. code:: bash\n\n environmentbase init\n\nThis initialization command will generate two files: ``config.json`` and\n``ami_cache.json``. You may override the config filename with the\n``--config-file`` parameter. This is useful when managing multiple\nstacks simultaneously.\n\nYou should now look at the generated ``config.json`` file and fill out\nat least the following fields:\n\n| ``template : ec2_key_default`` - This must be the name of a valid SSH\n key in your AWS account\n| ``template : s3_bucket`` - S3 bucket used to upload the generated\n cloudformation templates\n| ``logging : s3_bucket`` - S3 bucket used for cloudtrail and ELB\n logging\n\nYou must ensure that the above two buckets exist and that you have\naccess to write to them (they can be the same bucket). Also, the logging\ns3\\_bucket must have the correct access policy -- it needs to allow the\nAWS ELB and Cloudtrail accounts access to upload their logging data. See\na sample access policy\n`here `__, just\nreplace all instances of ``%%S3_BUCKET%%`` with your logging bucket name\nand attach the policy to your S3 bucket.\n\nYou may also edit the other fields to customize the environment to your\nliking. After you have configured your environment, run:\n\n.. code:: bash\n\n environmentbase create\n\nThis will generate the cloudformation templates using your updated\nconfig. It will save them both to S3 in your template bucket as well as\nlocally. You can use the config ``template.include_timestamp`` setting\nto toggle whether or not a timestamp will be included the template\nfilenames (This can be useful for keeping versioned templates, it is\nenabled by default). Then run:\n\n.. code:: bash\n\n environmentbase deploy\n\nThis will create a cloudformation stack from your generated template on\n`AWS `__\n\nYou can use the config setting ``global.monitor_stack`` to enable real\ntime tracking of the event stream from the stack deployment. You can\nthen enable ``global.write_stack_outputs`` to automatically save all the\nstack outputs to a local file as they are brought up in AWS. You can\nalso hook into the stack event stream with your own scripting using the\n``stack_event_hook()`` function in environmentbase. Simply override this\nfunction in your controller and inject any real time deployment\nscripting.\n\nYou may run the following command to delete your stack when you are done\nwith it:\n\n.. code:: bash\n\n environmentbase delete\n\nSee `File Descriptions `__ for a detailed\nexplanation on the various files generated and consumed by\nEnvironmentBase\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/AWSFrederick/cloudformation-environmentbase", "keywords": "", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "cfn-environment-base", "package_url": "https://pypi.org/project/cfn-environment-base/", "platform": "", "project_url": "https://pypi.org/project/cfn-environment-base/", "project_urls": { "Homepage": "https://github.com/AWSFrederick/cloudformation-environmentbase" }, "release_url": "https://pypi.org/project/cfn-environment-base/0.9.19/", "requires_dist": null, "requires_python": "", "summary": "Base environment for Troposphere based CFN project environments", "version": "0.9.19" }, "last_serial": 2903914, "releases": { "0.9.18": [ { "comment_text": "", "digests": { "md5": "2d6c9c1b96d8bdafae0b0312876a5466", "sha256": "bd6272b91714285beff94046f255f70bcc0eca5f741a61bf6316db6f1348af1b" }, "downloads": -1, "filename": "cfn-environment-base-0.9.18.tar.gz", "has_sig": false, "md5_digest": "2d6c9c1b96d8bdafae0b0312876a5466", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84293, "upload_time": "2017-05-27T03:44:08", "url": "https://files.pythonhosted.org/packages/b0/7c/e5480e48b142fe3825e36add7cb41b48f45d0388d6296311955cbe49a125/cfn-environment-base-0.9.18.tar.gz" } ], "0.9.19": [ { "comment_text": "", "digests": { "md5": "29848b24df7726daedf19d1a42e9ad47", "sha256": "33bee0ae5a704e8a27d24e9cf018f947bb3b305496328a3d107cee6e94fc659e" }, "downloads": -1, "filename": "cfn-environment-base-0.9.19.tar.gz", "has_sig": false, "md5_digest": "29848b24df7726daedf19d1a42e9ad47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84270, "upload_time": "2017-05-27T21:51:32", "url": "https://files.pythonhosted.org/packages/a5/90/b08032748b4f2cd04b64284130e783a6e8c3da4088fe939bfa5a38ec3409/cfn-environment-base-0.9.19.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "29848b24df7726daedf19d1a42e9ad47", "sha256": "33bee0ae5a704e8a27d24e9cf018f947bb3b305496328a3d107cee6e94fc659e" }, "downloads": -1, "filename": "cfn-environment-base-0.9.19.tar.gz", "has_sig": false, "md5_digest": "29848b24df7726daedf19d1a42e9ad47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84270, "upload_time": "2017-05-27T21:51:32", "url": "https://files.pythonhosted.org/packages/a5/90/b08032748b4f2cd04b64284130e783a6e8c3da4088fe939bfa5a38ec3409/cfn-environment-base-0.9.19.tar.gz" } ] }