Help us shape the future of Go! Take the 2026 Go Developer Survey

tfc

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCredentials added in v0.2.0

func NewCredentials(filepath, address, token string) (*tfe.Config, error)

Types

type Client added in v0.2.0

type Client struct {
	*tfe.Client
}

Client is the Terraform Enterprise and Terraform Cloud API client.

func NewClient added in v0.2.0

func NewClient(cfg *tfe.Config) (*Client, error)

NewClient creates a new Terraform Enterprise API client.

type RegistryModule

type RegistryModule struct {
	ID              *string                             `json:"id"`
	Name            *string                             `json:"name"`
	Provider        *string                             `json:"provider"`
	VersionStatuses []tfe.RegistryModuleVersionStatuses `json:"version_statuses"`
	Organization    *string                             `json:"organization"`
	Source          *string                             `json:"source"`
}

RegistryModule represents a Terraform Cloud registry module.

type Run

type Run struct {
	ID            *string   `json:"id"`
	Organization  *string   `json:"organization"`
	Workspace     *string   `json:"workspace"`
	Status        *string   `json:"status"`
	IsConfirmable *bool     `json:"is_confirmable"`
	CreatedAt     time.Time `json:"created_at"`
}

Run represents a Terraform workspaces run.

type TfCloud

type TfCloud interface {
	// Address returns a Terraform Cloud / Enterprise API endpoint addres.
	Address() string
	// RunList returns all the terraform workspace current runs.
	RunList(organization string) ([]*Run, error)
	// RunGet returns the specified terraform workspace run.
	RunGet(workspaceName, runID string) (*Run, error)
	// RunApply applys the specified terraform workspace run.
	RunApply(RunID string) error
	// WorkspaceList returns all the terraform workspaces in an organization.
	WorkspaceList(organization string) ([]*Workspace, error)
	// WorkspaceGet returns the specified terraform workspace.
	WorkspaceGet(organization, workspace string) (*Workspace, error)
	// WorkspaceUpdateVersion updates the terraform version config in the specified workspace.
	WorkspaceUpdateVersion(organization, workspace, version string) error
	// ModuleList returns all the terraform registry modules.
	ModuleList(organization string) ([]*RegistryModule, error)
	// ModuleGet returns the specified terraform registry module.
	ModuleGet(organization, name, provider string) (*RegistryModule, error)
}

TfCloud represents Terraform Cloud API client.

func NewTfCloud

func NewTfCloud(address, token string) (TfCloud, error)

NewTfCloud creates a new TfCloud interface

type Workspace

type Workspace struct {
	ID               *string   `json:"id"`
	Name             *string   `json:"name"`
	TerraformVersion *string   `json:"terraform_version"`
	ExecutionMode    *string   `json:"execution_mode"`
	AutoApply        *bool     `json:"auto_apply"`
	CurrentRun       *tfe.Run  `json:"current_run,omitempty"`
	VCSRepoName      *string   `json:"vcs_repo"`
	WorkingDirectory *string   `json:"working_directory"`
	ResourceCount    *int      `json:"resource_count"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

Workspace represents a Terraform Cloud workspace.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL