Skip to main content
https://github.com/rgreinho/tfpy/workflows/ci/badge.svg https://badge.fury.io/py/tfpy.svg

Create Terraform resources using Python.

Description

tfpy is a thin wrapper around terraformpy, aiming at providing a well defined structure to organize your terraform stacks and leverage the power of Python to define them rather than using HCL.

The goal is to have a repository layout inspired from Ansible where the stacks are driven by the variables.

For more information regarding how to create your stacks, please refer to the official terraformpy documentation.

Installation

tfpy requires Python 3.7+ to work

pip install tfpy

Usage

The tfpy command needs to be run at the root of your project.

The output will be created in a new subfolder within your project, named generated. For instance generated/gke/production/main.tf.json

Project layout

.
├── generated
│   └── commerce
│       └── staging
│           └── main.tf.json
├── library
│   ├── backend.py
│   └── provider.py
├── stacks
│   └── commerce
│       ├── README.md
│       ├── gke.tf.py
│       └── terraform.tf.py
└── vars
    ├── all
    │   ├── cartigan.yml
    │   └── config.yml
    └── staging
        └── commerce
            ├── gke.yml
            └── project.yml
  • generated: folder where the stack are stored as JSON once generated.

  • library: folder where you can place custom functions.

  • stacks: the stacks created using TerraformPy.

  • vars: the variables used to create the stacks.

Examples

Build a project stack without an environment:

tfpy generate organization

Build a project stack for a specific environment:

tfpy generate gke production

Metadata

Release files for tfpy 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfpy 0.6.0
File Size Uploaded Provenance Actions
tfpy-0.6.0.tar.gz 7.0 kB Without provenance Details for tfpy-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tfpy 0.6.0
File Interpreter ABI Platform Actions
tfpy-0.6.0-py3-none-any.whl Python 3 none any Details for tfpy-0.6.0-py3-none-any.whl

Total release size: 14.5 kB

Release files / tfpy-0.6.0.tar.gz

Download URL tfpy-0.6.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
99c6f8813d745e156636b36c1f22cd7dd9dc4d70685dde377a6ba13f05151e9e
BLAKE2b-256 checksum
How to use checksums
201310883a77940a8db08cd24ea4681361dece1d91621cb4a846b7d4fd6abb0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/2.7.17 Linux/5.3.0-1028-azure

Release files / tfpy-0.6.0-py3-none-any.whl

Download URL tfpy-0.6.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85338cab61261894c0ae7a81abed8cadd1f6d702ec37a2e546f7f3a78c274fcd
BLAKE2b-256 checksum
How to use checksums
d5f75d5dd76b82e0e3673255973ebe67b4c067edae595109d125a613c063fb6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/2.7.17 Linux/5.3.0-1028-azure

Security for tfpy 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page