Skip to main content

A Python client for the Terraform Cloud API

Project description

terrasnek

CircleCI codecov PyPI version Documentation Status GitHub issues GitHub license API Method Support

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 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


Note: This repo is not officially maintained by HashiCorp.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terrasnek-0.1.7.tar.gz (61.5 kB view details)

Uploaded Source

Built Distribution

terrasnek-0.1.7-py3-none-any.whl (122.3 kB view details)

Uploaded Python 3

File details

Details for the file terrasnek-0.1.7.tar.gz.

File metadata

  • Download URL: terrasnek-0.1.7.tar.gz
  • Upload date:
  • Size: 61.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for terrasnek-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7b41a1417e84804f8de5e71cabdbfa3b38f0350b4e6311e1479c3deb7d3fb815
MD5 284e7dce0a162343a6c750b35e7dc22f
BLAKE2b-256 37b66a6bb002f8a6bece4428c2fab7cf6df448232951748f9facd5bbce8a63a4

See more details on using hashes here.

File details

Details for the file terrasnek-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: terrasnek-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 122.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for terrasnek-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 651e50cb5a8571203802c9769304422ac91845bf9ed4b4979bb7fdb47b97bbc4
MD5 3dd40fb9bbbf0d6d37f99f09aa226aa5
BLAKE2b-256 70dd576d32a435f9e99c0f48ac633e46c5084f7eadf939f9d8addd11003056a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page