tfc

package
v0.0.0-...-e8a946a Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IoReader

func IoReader(reader io.Reader) (string, error)

Types

type Client

type Client struct {
	Workspace         Workspace
	WorkspaceVariable WorkspaceVariable
	TerraformVariable TerraformVariable
	Runs              Runs
	TFCClient         *tfe.Client
	Config            *Config
}

func NewClient

func NewClient(con *Config) (*Client, error)

type Config

type Config struct {
	OrgName               string
	Token                 string
	Address               string
	WorkspaceCreateOption *WorkspaceCreateOption
	TFCodeDir             *string
	Run                   Run
}

type Run

type Run struct {
	RefreshOnly   bool
	AutoApply     bool
	AutoQueueRuns bool
	Speculative   bool
	IsDestroy     bool
}

type Runs

type Runs interface {
	CreateConfig(wsname string) (*tfe.ConfigurationVersion, error)
	UploadConfig(wsname string) (*tfe.ConfigurationVersion, error)
	Create(wsname string) (*tfe.Run, error)
	SpeculativePlan(wsname string) ([]byte, string, error)
	Logs(id string) (string, error)
	StatusCheck(id, status string) (string, error)
}

type TerraformVariable

type TerraformVariable struct {
	Name      string
	Value     string
	Sensitive bool
}

type Workspace

type Workspace interface {
	Create(orgname string, wsc *WorkspaceCreateOption) (*tfe.Workspace, error)
	Read(orgname, wsname string) (*tfe.Workspace, error)
	Delete(orgname, wsname string) error
}

type WorkspaceCreateOption

type WorkspaceCreateOption struct {
	Name          string
	ExecutionMode string
	AutoApply     bool
}

type WorkspaceVariable

type WorkspaceVariable interface {
	Create(orgname, workspace string, tfVariables TerraformVariable) (*tfe.Variable, error)
	Update(orgname, workspace string, tfVariables TerraformVariable) (*tfe.Variable, error)
	List(orgname, workspace string) (*tfe.VariableList, error)
	Get(orgname, workspace, varname string) (*tfe.Variable, error)
	Delete(orgname, workspace, varname string) error
}

Jump to

Keyboard shortcuts

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