remote

package
v0.11.15 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colorer added in v0.11.9

type Colorer interface {
	Color(v string) string
}

Colorer is the interface that must be implemented to colorize strings.

type Colorize added in v0.11.9

type Colorize struct {
	// contains filtered or unexported fields
}

Colorize is used to print output when the -no-color flag is used. It will strip all ANSI escaped color codes which are set while the operation was executed in Terraform Enterprise.

When Terraform Enterprise supports run specific variables, this code can be removed as we can then pass the CLI flag to the backend and prevent the color codes from being written to the output.

func (*Colorize) Color added in v0.11.9

func (c *Colorize) Color(v string) string

Color will strip all ANSI escaped color codes and return a uncolored string.

type Remote

type Remote struct {
	// CLI and Colorize control the CLI output. If CLI is nil then no CLI
	// output will be done. If CLIColor is nil then no coloring will be done.
	CLI      cli.Ui
	CLIColor *colorstring.Colorize

	// ContextOpts are the base context options to set when initializing a
	// new Terraform context. Many of these will be overridden or merged by
	// Operation. See Operation for more details.
	ContextOpts *terraform.ContextOpts
	// contains filtered or unexported fields
}

Remote is an implementation of EnhancedBackend that performs all operations in a remote backend.

func New

func New(services *disco.Disco) *Remote

New creates a new initialized remote backend.

func (*Remote) CLIInit

func (b *Remote) CLIInit(opts *backend.CLIOpts) error

CLIInit implements backend.CLI

func (*Remote) Colorize

func (b *Remote) Colorize() Colorer

Colorize returns the Colorize structure that can be used for colorizing output. This is guaranteed to always return a non-nil value and so is useful as a helper to wrap any potentially colored strings.

func (*Remote) Configure

func (b *Remote) Configure(c *terraform.ResourceConfig) error

Configure configures the backend itself with the configuration given.

func (*Remote) Context added in v0.11.12

func (b *Remote) Context(op *backend.Operation) (*terraform.Context, state.State, error)

Context implements backend.Enhanced.

func (*Remote) DeleteState

func (b *Remote) DeleteState(name string) error

DeleteState removes the remote workspace if it exists.

func (*Remote) Input

Input is called to ask the user for input for completing the configuration.

func (*Remote) Operation

func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend.RunningOperation, error)

Operation implements backend.Enhanced

func (*Remote) State

func (b *Remote) State(name string) (state.State, error)

State returns the latest state of the given remote workspace. The workspace will be created if it doesn't exist.

func (*Remote) States

func (b *Remote) States() ([]string, error)

States returns a filtered list of remote workspace names.

func (*Remote) Validate

func (b *Remote) Validate(c *terraform.ResourceConfig) ([]string, []error)

Validate is called once at the beginning with the raw configuration and can return a list of warnings and/or errors.

Jump to

Keyboard shortcuts

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