Skip to main content

A Python client for the Terraform Cloud API

Project description

terrasnek

Python unittest Code Coverage

A Python Client for the Terraform Cloud API.

Using terrasnek

For more details on using each endpoint, checkout the test directory.

from terrasnek.api import TFC
import os

TFC_TOKEN = os.getenv("TFC_TOKEN", None)

if __name__ == "__main__":
    api = TFC(TFC_TOKEN)
    api.set_organization("YOUR_ORGANIZATION")

Contributing to terrasnek

Currently the following endpoints are supported:

Standard Endpoints
Admin Endpoints

Contributing to terrasnek

Linting the Code

make lint

Building Test Data

cd test/testdata/terraform/
tar -zcvf terrasnek_unittest_config_version.tar.gz src/*

Running Specific Tests

The test suite takes a long time to execute fully, since there is a lot of async work, and waiting for plans, applies, etc. In the scenario you want to just test a new implementation or change, use the below.

source test/secrets/secrets.sh
python3 -m unittest test/applies_test.py

Running All Tests

source test/secrets/secrets.sh
make coverage

Running the Tests with Coverage Info

source test/secrets/secrets.sh
make coverage

Publishing to PyPi

make pip-package
make pip-publish

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.3.tar.gz (27.8 kB view hashes)

Uploaded Source

Built Distribution

terrasnek-0.0.3-py3-none-any.whl (59.7 kB view hashes)

Uploaded Python 3

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