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

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

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

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terrasnek-0.0.14-py3-none-any.whl (99.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terrasnek-0.0.14.tar.gz
  • Upload date:
  • Size: 48.9 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.48.0 CPython/3.8.4

File hashes

Hashes for terrasnek-0.0.14.tar.gz
Algorithm Hash digest
SHA256 57a2de9ae8fa8588aad98ff40b3dc65a6592f904c21487d47ef27e4369bbbb67
MD5 7472a3e67baec791905b4c980b3e77b6
BLAKE2b-256 582ca189e08a5b08a865e64f254483581a076c61446dbdcddd6660b43ccf774d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: terrasnek-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 99.2 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.48.0 CPython/3.8.4

File hashes

Hashes for terrasnek-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 00b7045f8160d5e628e853e824a58a0d890471e9e9c94c91e50ec68e4a166f54
MD5 0c29a00974a2ec218d229a97245dd515
BLAKE2b-256 b0b3dd50f85fab35df460c06f9039cdebb42ae3fedcf6d8c4ec90b069c09ef6c

See more details on using hashes here.

Supported by

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