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.
pip install te2_sdk
Below is an example of how you trigger a plan
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:
run = ws_runs.request_run(request_type="apply", destroy=False)
###Completed Functionality
- Runs
- Plan
- Run
- Discard
- Get Log
- Variables
- Create
- Read
- Update
- Delete
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