A Python client for the Terraform Cloud API
Project description
terrasnek
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
- Account
- Applies
- Configuration Versions
- Cost Estimates
- Notification Configurations
- OAuth Clients
- OAuth Tokens
- Organizations
- Organization Memberships
- Organization Tokens
- Plan Exports
- Plans
- Policies
- Policy Checks
- Policy Sets
- Policy Set Parameters
- Registry Modules
- Runs
- Run Triggers
- SSH Keys
- State Versions
- State Version Outputs
- Team Access
- Team Memberships
- Team Tokens
- Teams
- User Tokens
- Users
- Variables
- Workspaces
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
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
terrasnek-0.0.3.tar.gz
(27.8 kB
view hashes)
Built Distribution
terrasnek-0.0.3-py3-none-any.whl
(59.7 kB
view hashes)
Close
Hashes for terrasnek-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9340529e2df758d385b215db41138663b4cf49a246a3b3b470ebd04c6e36d7f6 |
|
MD5 | 56e782bb001c5955f1e2ada7b63fc9f0 |
|
BLAKE2b-256 | 70042aefc3153939f72e5b3b4f22d4e7dda3552f40e4effd75bf1d3c60497610 |