terraform/vendor/github.com/hashicorp/go-tfe
Sander van Harmelen 77844852e6 go-mod: update go-tfe 2018-11-20 17:06:19 +01:00
..
LICENSE vendor: catch up vendoring 2018-11-08 14:20:19 -08:00
README.md depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
apply.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
configuration_version.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
go.mod Make the Atlas backend work after updating depencies 2018-11-15 20:34:31 +01:00
go.sum Make the Atlas backend work after updating depencies 2018-11-15 20:34:31 +01:00
logreader.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
oauth_client.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
oauth_token.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
organization.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
organization_token.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
plan.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
policy.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
policy_check.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
policy_set.go Make the Atlas backend work after updating depencies 2018-11-15 20:34:31 +01:00
run.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
ssh_key.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
state_version.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
team.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
team_access.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
team_member.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
team_token.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
tfe.go go-mod: update go-tfe 2018-11-20 17:06:19 +01:00
type_helpers.go vendor: catch up vendoring 2018-11-08 14:20:19 -08:00
user.go vendor: catch up vendoring 2018-11-08 14:20:19 -08:00
validations.go vendor: catch up vendoring 2018-11-08 14:20:19 -08:00
variable.go depencies: update `go-tfe` 2018-11-13 16:24:45 +01:00
workspace.go go-mod: update go-tfe 2018-11-20 17:06:19 +01:00

README.md

Terraform Enterprise Go Client

Build Status GitHub license GoDoc Go Report Card GitHub issues

This is an API client for Terraform Enterprise.

NOTE

The Terraform Enterprise API endpoints are in beta and are subject to change! So that means this API client is also in beta and is also subject to change. We will indicate any breaking changes by releasing new versions. Until the release of v1.0, any minor version changes will indicate possible breaking changes. Patch version changes will be used for both bugfixes and non-breaking changes.

Coverage

Currently the following endpoints are supported:

Installation

Installation can be done with a normal go get:

go get -u github.com/hashicorp/go-tfe

Documentation

For complete usage of the API client, see the full package docs.

Usage

import tfe "github.com/hashicorp/go-tfe"

Construct a new TFE client, then use the various endpoints on the client to access different parts of the Terraform Enterprise API. For example, to list all organizations:

config := &tfe.Config{
	Token: "insert-your-token-here",
}

client, err := tfe.NewClient(config)
if err != nil {
	log.Fatal(err)
}

orgs, err := client.Organizations.List(context.Background(), OrganizationListOptions{})
if err != nil {
	log.Fatal(err)
}

Examples

The examples directory contains a couple of examples. One of which is listed here as well:

package main

import (
	"log"

	tfe "github.com/hashicorp/go-tfe"
)

func main() {
	config := &tfe.Config{
		Token: "insert-your-token-here",
	}

	client, err := tfe.NewClient(config)
	if err != nil {
		log.Fatal(err)
	}

	// Create a context
	ctx := context.Background()

	// Create a new organization
	options := tfe.OrganizationCreateOptions{
		Name:  tfe.String("example"),
		Email: tfe.String("info@example.com"),
	}

	org, err := client.Organizations.Create(ctx, options)
	if err != nil {
		log.Fatal(err)
	}

	// Delete an organization
	err = client.Organizations.Delete(ctx, org.Name)
	if err != nil {
		log.Fatal(err)
	}
}

Issues and Contributing

If you find an issue with this package, please report an issue. If you'd like, we welcome any contributions. Fork this repository and submit a pull request.