Skip to main content

Simple Wrapper for Terraform Enterprise 2 Jobs

Project description

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

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

te2_sdk-0.1.5.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

te2_sdk-0.1.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file te2_sdk-0.1.5.tar.gz.

File metadata

  • Download URL: te2_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for te2_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 9f8e3c5482d8bd7b2e6ad4c1c32e4949150d2abde5b7a3aa14f96548031da0f0
MD5 4a3099cf0c12bcddbf31891689aa37f0
BLAKE2b-256 42676117df29ffbd77a705b87f16245b7afe5596733e619463261ab53b27d92b

See more details on using hashes here.

File details

Details for the file te2_sdk-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for te2_sdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e8d496a06ce43ddeb1fb01332f6a56eecba3d261fbe000c6f2752085a3554f7c
MD5 014e3d2f5d9b2dbc2ee926884180a0b3
BLAKE2b-256 cd3a59cfa25c10d7f253f2ebec23a297dc08727199ca20dd5b2a048a5c6da46b

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