terraform-parser


Nameterraform-parser JSON
Version 0.580.24088 PyPI version JSON
download
home_pagehttps://github.com/klahnakoski/terraform-parser
SummaryTerraform Parser - Parse Terraform to JSON
upload_time2024-03-28 22:15:31
maintainerNone
docs_urlNone
authorKyle Lahnakoski
requires_pythonNone
licenseMPL 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # terraform-parser

[![PyPI Latest Release](https://img.shields.io/pypi/v/terraform-parser.svg)](https://pypi.org/project/terraform-parser/)
[![Build Status](https://app.travis-ci.com/klahnakoski/terraform-parser.svg?branch=master)](https://travis-ci.com/github/klahnakoski/terraform-parser)
 [![Coverage Status](https://coveralls.io/repos/github/klahnakoski/terraform-parser/badge.svg?branch=dev)](https://coveralls.io/github/klahnakoski/terraform-parser?branch=dev)
[![Downloads](https://pepy.tech/badge/terraform-parser/month)](https://pepy.tech/project/terraform-parser)


Parse Terraform scripts into JSON


## Status

**Dec 2022** - This an experimental parser that can parse HCL2

## Problem

I am uncertain if configuration/template language, such as Terraform, should include scripting.  It is beneficial to have a simple configuration, albeit redundant, for VCS tracking and simple diff for merge reviews.  

I would advocate a high level langauge (HLL), like Python, be used to produce the Terraform configuration with both HLL and Terraform be included in the repository. HLL is familiar, and the Terraform changes are easy to review.

Using an HLL for Terraform generation removes the need for the [quirky template expressions](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#template-expressions), complex expressions, and modules. 

The hope is to 

* parse terraform into Json data
* merge data from different terraform to single spec
* allow Python to modify data easily
* write out terraform (in diff-friendly way)


## References

* Look at what is done here - https://github.com/starhawking/python-terrascript
* Existing parser for [HCL1](https://github.com/virtuald/pyhcl)
* Existing parser for [HCL2](https://pypi.org/project/python-hcl2/)
* Unicode Identifiers - [UAX31](http://unicode.org/reports/tr31/)
* [Terraform Spec](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md)
* [Diagram terraform](https://diagrams.mingrammer.com/docs/getting-started/installation
* [Graphviz](https://www.graphviz.org/)




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/klahnakoski/terraform-parser",
    "name": "terraform-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Kyle Lahnakoski",
    "author_email": "kyle@lahnakoski.com",
    "download_url": "https://files.pythonhosted.org/packages/ad/d0/cd19120d0e05b0a74ab2e0fc60870c5b068cb293095e64216461906243dd/terraform-parser-0.580.24088.tar.gz",
    "platform": null,
    "description": "# terraform-parser\r\n\r\n[![PyPI Latest Release](https://img.shields.io/pypi/v/terraform-parser.svg)](https://pypi.org/project/terraform-parser/)\r\n[![Build Status](https://app.travis-ci.com/klahnakoski/terraform-parser.svg?branch=master)](https://travis-ci.com/github/klahnakoski/terraform-parser)\r\n [![Coverage Status](https://coveralls.io/repos/github/klahnakoski/terraform-parser/badge.svg?branch=dev)](https://coveralls.io/github/klahnakoski/terraform-parser?branch=dev)\r\n[![Downloads](https://pepy.tech/badge/terraform-parser/month)](https://pepy.tech/project/terraform-parser)\r\n\r\n\r\nParse Terraform scripts into JSON\r\n\r\n\r\n## Status\r\n\r\n**Dec 2022** - This an experimental parser that can parse HCL2\r\n\r\n## Problem\r\n\r\nI am uncertain if configuration/template language, such as Terraform, should include scripting.  It is beneficial to have a simple configuration, albeit redundant, for VCS tracking and simple diff for merge reviews.  \r\n\r\nI would advocate a high level langauge (HLL), like Python, be used to produce the Terraform configuration with both HLL and Terraform be included in the repository. HLL is familiar, and the Terraform changes are easy to review.\r\n\r\nUsing an HLL for Terraform generation removes the need for the [quirky template expressions](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#template-expressions), complex expressions, and modules. \r\n\r\nThe hope is to \r\n\r\n* parse terraform into Json data\r\n* merge data from different terraform to single spec\r\n* allow Python to modify data easily\r\n* write out terraform (in diff-friendly way)\r\n\r\n\r\n## References\r\n\r\n* Look at what is done here - https://github.com/starhawking/python-terrascript\r\n* Existing parser for [HCL1](https://github.com/virtuald/pyhcl)\r\n* Existing parser for [HCL2](https://pypi.org/project/python-hcl2/)\r\n* Unicode Identifiers - [UAX31](http://unicode.org/reports/tr31/)\r\n* [Terraform Spec](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md)\r\n* [Diagram terraform](https://diagrams.mingrammer.com/docs/getting-started/installation\r\n* [Graphviz](https://www.graphviz.org/)\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MPL 2.0",
    "summary": "Terraform Parser - Parse Terraform to JSON",
    "version": "0.580.24088",
    "project_urls": {
        "Homepage": "https://github.com/klahnakoski/terraform-parser"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f1da19700952bc08cfff0805515d8a4953201cd2b2d27cfe5d11f8b0facff56",
                "md5": "ffb05b0c3ed3d3abd8b2766d8081f891",
                "sha256": "afb21528486a29bf92f705fc61be86c440cba5012d1ce661b281f32cddf5f404"
            },
            "downloads": -1,
            "filename": "terraform_parser-0.580.24088-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ffb05b0c3ed3d3abd8b2766d8081f891",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14420,
            "upload_time": "2024-03-28T22:15:29",
            "upload_time_iso_8601": "2024-03-28T22:15:29.846183Z",
            "url": "https://files.pythonhosted.org/packages/4f/1d/a19700952bc08cfff0805515d8a4953201cd2b2d27cfe5d11f8b0facff56/terraform_parser-0.580.24088-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "add0cd19120d0e05b0a74ab2e0fc60870c5b068cb293095e64216461906243dd",
                "md5": "7560ede2447a515f3e045073394482e3",
                "sha256": "cdd11813d95e7d6946e727cfa16f4f27549b36f599b0d308897360e4b1f67b3f"
            },
            "downloads": -1,
            "filename": "terraform-parser-0.580.24088.tar.gz",
            "has_sig": false,
            "md5_digest": "7560ede2447a515f3e045073394482e3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13164,
            "upload_time": "2024-03-28T22:15:31",
            "upload_time_iso_8601": "2024-03-28T22:15:31.607695Z",
            "url": "https://files.pythonhosted.org/packages/ad/d0/cd19120d0e05b0a74ab2e0fc60870c5b068cb293095e64216461906243dd/terraform-parser-0.580.24088.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-28 22:15:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klahnakoski",
    "github_project": "terraform-parser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "terraform-parser"
}
        
Elapsed time: 0.79303s