terrasnek
A Python Client for the Terraform Cloud API.
Overview
The goal of this project is to support all endpoints available in the
Terraform Cloud API
and Terraform Enterprise API.
In general, terrasnek is developed against the Terraform Cloud APIs first (as
most features are released there first and may not be available in Terraform
Enterprise), but all endpoints are loved equally and this project intends to
support both types of users.
Note: This project is tested against Terraform Enterprise often, but the code coverage
represented in this repo will always represent coverage against Terraform Cloud
Business Tier (skipping all admin modules), so the coverage percentage
is higher than represented in the badge.
Terraform Enterprise Release Notes Terraform Cloud API Changelog
Note: Terraform Enterprise is the self-hosted distribution of Terraform Cloud. It offers enterprises a private instance of the Terraform Cloud application, with no resource limits and with additional enterprise-grade architectural features like audit logging and SAML single sign-on.
Using terrasnek
For more details on using each endpoint, check out the
docs or the test
directory.
from terrasnek.api import TFC
import os
TFC_TOKEN = os.getenv("TFC_TOKEN", None)
TFC_URL = os.getenv("TFC_URL", None) # ex: https://app.terraform.io
# set to True if you want to use HTTP or insecure HTTPS
SSL_VERIFY = os.getenv("SSL_VERIFY", False)
if __name__ == "__main__":
api = TFC(TFC_TOKEN, url=TFC_URL, verify=SSL_VERIFY)
api.set_org("YOUR_ORGANIZATION")
terrasnek to Terraform Cloud API Spec Completeness
To compare terrasnek implemented endpoints to those listed on the Terraform
Cloud API docs, view the auto-generated
TERRASNEK_API_COVERAGE_COMPLETENESS.md
file. The goal is to always have over 95% of all published endpoints implemented
at any time.
terrasnek Common Use Case Examples
See the terrasnek docs. You
can download the docs as a PDF directly from readthedocs.io.
Contributing to terrasnek
If you'd like to contribute to terrasnek, review CONTRIBUTING.md.
Relevant Blogs
- Migrating a Lot of State with Python and the Terraform Cloud API
- The Power of the Terraform API: How to Easily Migrate Any Data Between Enterprise and Cloud
Note: This repo is not officially maintained by HashiCorp.
Metadata
Release files for terrasnek 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| terrasnek-0.1.14.tar.gz | 75.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| terrasnek-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 223.2 kB
Release files / terrasnek-0.1.14.tar.gz
| Download URL | terrasnek-0.1.14.tar.gz |
|---|---|
| Size | 75.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
255b97ffa2ca747d0b27cbac9c8ffe97202e94ef1245a87c4c29fd6ff3e617b7
|
|
BLAKE2b-256 checksum How to use checksums |
8de69450560c4bd1df7e4dfb8fc60e2aa8608ce4a2fd8347b91d2d10d78c29dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.8.2 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18
|
Release files / terrasnek-0.1.14-py3-none-any.whl
| Download URL | terrasnek-0.1.14-py3-none-any.whl |
|---|---|
| Size | 147.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6f4cc4088b3fc0b3627089f600c347c785c5a9c7210bfc86e17d0e718b176d0
|
|
BLAKE2b-256 checksum How to use checksums |
5e78b5643882445fd72b21cf5e96eb00ec4c840c13c2b642d10aad06d542fa29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.8.2 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18
|