Skip to main content
Copyright (c) 2017 Rory Chatterton

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Description: # Terraform 2 SDK [![Build Status](https://travis-ci.org/westpac-cloud-engineering/Terraform-Enterprise-2-Python-SDK.svg?branch=master)](https://travis-ci.org/westpac-cloud-engineering/Terraform-Enterprise-2-Python-SDK) [![codecov](https://codecov.io/gh/westpac-cloud-engineering/Terraform-Enterprise-2-Python-SDK/branch/master/graph/badge.svg)](https://codecov.io/gh/westpac-cloud-engineering/Terraform-Enterprise-2-Python-SDK)

SDK to call Terraform Enterprise 2 using Python.

This SDK was developed to wrap Restful API calls to Terraform Enterprise 2, in order to trigger Plans, Applys and Variable updates using Jenkins.

## How to install

```
pip install te2_sdk
```

## Triggering a Run
Below is an example of how you trigger a plan

```python
from te2_sdk import te2

client = te2.TE2Client(
organisation="MY_TERRAFORM_ENTERPRISE_ORG",
atlas_token="SECRET_TOKEN_HERE",
base_url="https://atlas.hashicorp.com/api/v2" # Change this if you are using a private install
)

ws_runs = te2.TE2WorkspaceRuns(client=client, workspace_name="My Workspace Name" )
run = ws_runs.request_run(request_type="plan", destroy=False)

```

And to do a run:
```python
run = ws_runs.request_run(request_type="apply", destroy=False, run_id = "RUN_ID_FROM_PLAN")
```

### Completed Functionality

- [x] Runs
- [x] Plan
- [x] Run
- [x] Discard
- [x] Get Log
- [x] Variables
- [x] Create
- [x] Read
- [x] Update
- [x] Delete

### Incomplete Functionality
The following items are not in development, as these Day 0 operations will eventually be wrapped up in an official Terraform Provider.
- [ ] Workspaces
- [ ] Sentinel
- [ ] Teams
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Text Processing

Release files for te2-sdk 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for te2-sdk 0.1.5
File Size Uploaded
te2_sdk-0.1.5.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for te2-sdk 0.1.5
File Interpreter ABI Platform
te2_sdk-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / te2_sdk-0.1.5.tar.gz

Download URL te2_sdk-0.1.5.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9f8e3c5482d8bd7b2e6ad4c1c32e4949150d2abde5b7a3aa14f96548031da0f0
BLAKE2b-256 checksum
How to use checksums
42676117df29ffbd77a705b87f16245b7afe5596733e619463261ab53b27d92b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / te2_sdk-0.1.5-py3-none-any.whl

Download URL te2_sdk-0.1.5-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8d496a06ce43ddeb1fb01332f6a56eecba3d261fbe000c6f2752085a3554f7c
BLAKE2b-256 checksum
How to use checksums
cd3a59cfa25c10d7f253f2ebec23a297dc08727199ca20dd5b2a048a5c6da46b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page