A Python client for the Terraform Cloud API
Project description
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. It's possible that some of these endpoints won't work if you're working against an older version of Terraform Enterprise.
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
documentation.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file terrasnek-0.1.5.tar.gz
.
File metadata
- Download URL: terrasnek-0.1.5.tar.gz
- Upload date:
- Size: 57.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02d2887b3123e54d16d532d8c012b7085ab81ec838a5f5061c0c06262cf034d |
|
MD5 | c840e245ea9f387fdcaa7fae7d17e746 |
|
BLAKE2b-256 | ede80559bccbdd3b716a0b1b1747135df97b8929ab7f94592883a1007de87cda |
File details
Details for the file terrasnek-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: terrasnek-0.1.5-py3-none-any.whl
- Upload date:
- Size: 114.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f01f40a4f3ad05515c66c403a0b7a59fe8e99089528ae6fe2b463d64b6ea74 |
|
MD5 | 28f82399aa8be142c502d9c3fc4ff0bd |
|
BLAKE2b-256 | bb90c640abab5116c49c5ab658b7ff3820bbee5468d06d802ff4299fbbbf2ba2 |