{"id":16048301,"url":"https://github.com/rgreinho/tfpy","last_synced_at":"2025-03-18T04:30:58.410Z","repository":{"id":57474876,"uuid":"257696073","full_name":"rgreinho/tfpy","owner":"rgreinho","description":"Create Terraform resources using Python","archived":false,"fork":false,"pushed_at":"2020-06-28T20:42:07.000Z","size":297,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T07:02:02.158Z","etag":null,"topics":["python","terraform"],"latest_commit_sha":null,"homepage":"http://rgreinho.github.io/tfpy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgreinho.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-21T19:30:52.000Z","updated_at":"2021-11-18T20:48:01.000Z","dependencies_parsed_at":"2022-09-10T04:05:00.927Z","dependency_job_id":null,"html_url":"https://github.com/rgreinho/tfpy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgreinho%2Ftfpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgreinho%2Ftfpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgreinho%2Ftfpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgreinho%2Ftfpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgreinho","download_url":"https://codeload.github.com/rgreinho/tfpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902271,"owners_count":20366259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","terraform"],"created_at":"2024-10-09T00:06:12.715Z","updated_at":"2025-03-18T04:30:58.153Z","avatar_url":"https://github.com/rgreinho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"tfpy\n====\n\n.. image:: https://github.com/rgreinho/tfpy/workflows/ci/badge.svg\n   :target: https://github.com/rgreinho/tfpy/actions?query=workflow%3Aci\n\n.. image:: https://badge.fury.io/py/tfpy.svg\n   :target: https://badge.fury.io/py/tfpy\n\nCreate Terraform resources using Python.\n\nDescription\n-----------\n\n``tfpy`` is a thin wrapper around `terraformpy`_, aiming at providing a well defined\nstructure to organize your `terraform`_ stacks and leverage the power of Python to\ndefine them rather than using `HCL`_.\n\nThe goal is to have a repository layout inspired from `Ansible \u003chttps://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout\u003e`_\nwhere the stacks are driven by the variables.\n\nFor more information regarding how to create your stacks, please refer to the official\n`terraformpy`_ documentation.\n\nInstallation\n------------\n\ntfpy requires Python 3.7+ to work\n\n::\n\n  pip install tfpy\n\nUsage\n-----\n\nThe ``tfpy`` command needs to be run at the root of your project.\n\nThe output will be created in a new subfolder within your project, named ``generated``.\nFor instance ``generated/gke/production/main.tf.json``\n\nProject layout\n^^^^^^^^^^^^^^\n\n::\n\n  .\n  ├── generated\n  │   └── commerce\n  │       └── staging\n  │           └── main.tf.json\n  ├── library\n  │   ├── backend.py\n  │   └── provider.py\n  ├── stacks\n  │   └── commerce\n  │       ├── README.md\n  │       ├── gke.tf.py\n  │       └── terraform.tf.py\n  └── vars\n      ├── all\n      │   ├── cartigan.yml\n      │   └── config.yml\n      └── staging\n          └── commerce\n              ├── gke.yml\n              └── project.yml\n\n* ``generated``: folder where the stack are stored as JSON once generated.\n* ``library``: folder where you can place custom functions.\n* ``stacks``: the stacks created using TerraformPy.\n* ``vars``: the variables used to create the stacks.\n\nExamples\n^^^^^^^^\n\nBuild a project stack without an environment::\n\n  tfpy generate organization\n\nBuild a project stack for a specific environment::\n\n  tfpy generate gke production\n\n\n.. _HCL: https://github.com/hashicorp/hcl\n.. _terraform: https://www.terraform.io\n.. _terraformpy: https://github.com/NerdWalletOSS/terraformpy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgreinho%2Ftfpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgreinho%2Ftfpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgreinho%2Ftfpy/lists"}