tfcw

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RenderVariablesTypeTFC refers to a Terraform Cloud rendering
	RenderVariablesTypeTFC RenderVariablesType = "tfc"

	// RenderVariablesTypeLocal refers to a local rendering
	RenderVariablesTypeLocal RenderVariablesType = "local"

	// VariableExpirationsName is the name of the variable used for storing VariableExpirations in TFC
	VariableExpirationsName string = "__TFCW_VARIABLES_EXPIRATIONS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Vault                   *providerVault.Client
	S5                      *providerS5.Client
	Env                     *providerEnv.Client
	TFC                     *tfc.Client
	Context                 context.Context
	ProcessedVariablesMutex sync.Mutex
	ProcessedVariables      map[string]schemas.VariableKind
	Backoff                 *backoff.Backoff
}

Client aggregates provider clients

func NewClient

func NewClient(cfg *schemas.Config) (c *Client, err error)

NewClient instantiate a Client from a provider Config

func (*Client) ApproveRun

func (c *Client) ApproveRun(runID, message string) error

ApproveRun given its ID

func (*Client) ConfigureWorkspace

func (c *Client) ConfigureWorkspace(cfg *schemas.Config, dryRun bool) (w *tfc.Workspace, err error)

ConfigureWorkspace check and remediate the configuration of the configured workspace

func (*Client) CreateRun

func (c *Client) CreateRun(cfg *schemas.Config, w *tfc.Workspace, opts *TFCCreateRunOptions) error

CreateRun triggers a `run` over the TFC API

func (*Client) DeleteAllWorkspaceVariables

func (c *Client) DeleteAllWorkspaceVariables(w *tfc.Workspace) (err error)

DeleteAllWorkspaceVariables delete the all the variables present on the workspace

func (*Client) DeleteWorkspaceVariables

func (c *Client) DeleteWorkspaceVariables(w *tfc.Workspace, variables schemas.Variables) (err error)

DeleteWorkspaceVariables delete the variables list passed as an argument if they are present on the workspace

func (*Client) DiscardRun

func (c *Client) DiscardRun(runID, message string) error

DiscardRun given its ID

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(organization, workspace string) (*tfc.Workspace, error)

GetWorkspace returns a workspace given its name and organization

func (*Client) GetWorkspaceCurrentRunID

func (c *Client) GetWorkspaceCurrentRunID(w *tfc.Workspace) (string, error)

GetWorkspaceCurrentRunID returns the status of the configured workspace

func (*Client) GetWorkspaceStatus

func (c *Client) GetWorkspaceStatus(cfg *schemas.Config) error

GetWorkspaceStatus returns the status of the configured workspace

func (*Client) RenderVariablesLocally

func (c *Client) RenderVariablesLocally(cfg *schemas.Config) error

RenderVariablesLocally issues a rendering of all variables defined in a schemas.Config object on TFC

func (*Client) RenderVariablesOnTFC

func (c *Client) RenderVariablesOnTFC(cfg *schemas.Config, w *tfc.Workspace, dryRun, forceUpdate bool) error

RenderVariablesOnTFC issues a rendering of all variables defined in a schemas.Config object on TFC

func (*Client) SetWorkspaceOperations

func (c *Client) SetWorkspaceOperations(w *tfc.Workspace, operations bool) (err error)

SetWorkspaceOperations update the workspace operations value

type RenderVariablesType

type RenderVariablesType string

RenderVariablesType defines possible rendering methods

type TFCCreateRunOptions

type TFCCreateRunOptions struct {
	AutoApprove  bool
	AutoDiscard  bool
	NoPrompt     bool
	OutputPath   string
	Message      string
	StartTimeout time.Duration
}

TFCCreateRunOptions handles configuration variables for creating a new run on TFE

type TFCRunType

type TFCRunType string

TFCRunType defines possible TFC run types

const (
	// TFCRunTypePlan refers to a TFC `plan`
	TFCRunTypePlan TFCRunType = "plan"

	// TFCRunTypeApply refers to a TFC `apply`
	TFCRunTypeApply TFCRunType = "apply"
)

type TFCVariables

type TFCVariables map[tfc.CategoryType]map[string]*tfc.Variable

TFCVariables gives us an accessible fashion for managing all our variables independently of their kind

Jump to

Keyboard shortcuts

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