terraformation


Nameterraformation JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryA simple Terraform wrapper to use variable definition files if they match the workspace name.
upload_time2023-04-16 18:17:05
maintainer
docs_urlNone
author
requires_python
licenseMIT License Copyright (c) 2023 Adar Nimrod Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords terraform
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            tf
##

.. image:: https://git.shore.co.il/nimrod/tf/badges/main/pipeline.svg
    :target: https://git.shore.co.il/nimrod/tf/-/commits/main
    :alt: pipeline status

A simple Terraform wrapper to use variable definition files if they match the
workspace name.

Rationale
---------

With workspaces, one can use the same module in different environments with
minor changes like different domain name, size of a cluster, instance type.
One can use variable definition files to store the values for each workspace in
a dedicated file. This wrapper replaces the following:

.. code:: shell

   terraform workspace select prod
   terraform plan -var-files=prod.tfvars -out tfplan

to:

.. code:: shell

   terraform workspace select prod
   tf plan -out tfplan

Installation
------------

.. code:: shell

   python3 -m pip install terraformation

The wrapper is a single Python3 script with no external dependencies. If you
prefer, you can download the :code:`tf.py` and use that instead.

Usage
-----

Replace :code:`terraform` with :code:`tf`. In case there's a variable
definitions file (that ends with :code:`.tfvars`) that matches the current
workspace name (if the current workspace name is :code:`prod` and a file named
:code:`prod.tfvars` exists) than a :code:`-var-file=prod.tfvars` argument is
added to the relevant commands (like :code:`plan` and :code:`import`). All
other arguments are kept as they were. Similarly, if a directory exists with
the same name as the workspace, for all the files inside that directory that
end with :code:`.tfvars`, a :code:`-var-file` argument is added. For example:
:code:`-var-file=prod/a.tfvars` and :code:`-var-file=prod/b.tfvars`.

License
-------

This software is licensed under the MIT license (see the :code:`LICENSE.txt`
file).

Author
------

Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website
<https://www.shore.co.il/>`_. Patches are welcome via `git send-email
<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located
at: https://git.shore.co.il/nimrod/.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "terraformation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "terraform",
    "author": "",
    "author_email": "Nimrod Adar <nimrod@shore.co.il>",
    "download_url": "https://files.pythonhosted.org/packages/49/fa/dbbba9a48d72cebed0b5f8e7b4d98db062db7d060508b90e5d0621ba490f/terraformation-0.1.0.tar.gz",
    "platform": null,
    "description": "tf\n##\n\n.. image:: https://git.shore.co.il/nimrod/tf/badges/main/pipeline.svg\n    :target: https://git.shore.co.il/nimrod/tf/-/commits/main\n    :alt: pipeline status\n\nA simple Terraform wrapper to use variable definition files if they match the\nworkspace name.\n\nRationale\n---------\n\nWith workspaces, one can use the same module in different environments with\nminor changes like different domain name, size of a cluster, instance type.\nOne can use variable definition files to store the values for each workspace in\na dedicated file. This wrapper replaces the following:\n\n.. code:: shell\n\n   terraform workspace select prod\n   terraform plan -var-files=prod.tfvars -out tfplan\n\nto:\n\n.. code:: shell\n\n   terraform workspace select prod\n   tf plan -out tfplan\n\nInstallation\n------------\n\n.. code:: shell\n\n   python3 -m pip install terraformation\n\nThe wrapper is a single Python3 script with no external dependencies. If you\nprefer, you can download the :code:`tf.py` and use that instead.\n\nUsage\n-----\n\nReplace :code:`terraform` with :code:`tf`. In case there's a variable\ndefinitions file (that ends with :code:`.tfvars`) that matches the current\nworkspace name (if the current workspace name is :code:`prod` and a file named\n:code:`prod.tfvars` exists) than a :code:`-var-file=prod.tfvars` argument is\nadded to the relevant commands (like :code:`plan` and :code:`import`). All\nother arguments are kept as they were. Similarly, if a directory exists with\nthe same name as the workspace, for all the files inside that directory that\nend with :code:`.tfvars`, a :code:`-var-file` argument is added. For example:\n:code:`-var-file=prod/a.tfvars` and :code:`-var-file=prod/b.tfvars`.\n\nLicense\n-------\n\nThis software is licensed under the MIT license (see the :code:`LICENSE.txt`\nfile).\n\nAuthor\n------\n\nNimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website\n<https://www.shore.co.il/>`_. Patches are welcome via `git send-email\n<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located\nat: https://git.shore.co.il/nimrod/.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Adar Nimrod  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A simple Terraform wrapper to use variable definition files if they match the workspace name.",
    "version": "0.1.0",
    "split_keywords": [
        "terraform"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f9ec0c36433da6f7e9dcfcade79ce0fb68d83bbf3d8d7c27c27ab9efa0b4c8d7",
                "md5": "a1367cf06b700e8444539f0bc4895593",
                "sha256": "fae8f23bbf5d56ec0725e33d5dcd25bf2c3f89345402bd5f413501de4a1c8c64"
            },
            "downloads": -1,
            "filename": "terraformation-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1367cf06b700e8444539f0bc4895593",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4804,
            "upload_time": "2023-04-16T18:17:03",
            "upload_time_iso_8601": "2023-04-16T18:17:03.522573Z",
            "url": "https://files.pythonhosted.org/packages/f9/ec/0c36433da6f7e9dcfcade79ce0fb68d83bbf3d8d7c27c27ab9efa0b4c8d7/terraformation-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49fadbbba9a48d72cebed0b5f8e7b4d98db062db7d060508b90e5d0621ba490f",
                "md5": "f751ba15add23ba5921906f187cb044c",
                "sha256": "a6911b5627764e8479c44ab1277dd0d21db74a5d617806fae784b65420855416"
            },
            "downloads": -1,
            "filename": "terraformation-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f751ba15add23ba5921906f187cb044c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3710,
            "upload_time": "2023-04-16T18:17:05",
            "upload_time_iso_8601": "2023-04-16T18:17:05.366739Z",
            "url": "https://files.pythonhosted.org/packages/49/fa/dbbba9a48d72cebed0b5f8e7b4d98db062db7d060508b90e5d0621ba490f/terraformation-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-16 18:17:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "terraformation"
}
        
Elapsed time: 0.07396s