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

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. terrasnek has been tested against TFE v202002-2 (419) and is subject to this stability policy.

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.

Requirements

To make full usage of all the tools and commands here, you should have installed:

All Python requirements are outlined in pip-reqs.txt.

Using terrasnek

For more details on using each endpoint, check out the docs or the test directory. I also wrote a blog post showing how this library can be used.

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
SSL_VERIFY = os.getenv("SSL_VERIFY", None)  # set to True if you want to use HTTP or insecure HTTPS

if __name__ == "__main__":
    api = TFC(TFC_TOKEN, url=TFC_URL, ssl_verify=SSL_VERIFY)
    api.set_org("YOUR_ORGANIZATION")

terrasnek to Terraform Cloud API Spec Parity

To see the feature parity between the Terraform Cloud API spec and the available methods in terrasnek, view the auto-generated API_COMPARISON.md file.

terrasnek Common Use Case Examples

See the terrasnek documentation.

Contributing to terrasnek

If you'd like to contribute to terrasnek, review CONTRIBUTING.md.


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.0.5.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

terrasnek-0.0.5-py3-none-any.whl (95.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terrasnek-0.0.5.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for terrasnek-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fdac517ff23d8baa4a82afe641ee6668aea59f45dec43a7f72b366dccb9d9208
MD5 fec0cf674eef8c79610e729903a29ee1
BLAKE2b-256 924b2d15900a3d643419abb4e680a0228728903bf15d635fc11fd7197a054bbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: terrasnek-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 95.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for terrasnek-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 11fb7b3505ee6d6f112c2a0e30e14fd17cf725ab7c231f6d4e0fda5088f36834
MD5 6ebc65172806a32176c0c1df614201ac
BLAKE2b-256 28f01b68a391b910e60df7105ec923b32b9b29404a9f4b5a9a3c6a4c4c8fad04

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