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

terraform

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MPL-2.0 Imports: 16 Imported by: 10

Documentation

Index

Constants

View Source
const AppName = "app"

Variables

This section is empty.

Functions

func CheckTerraform added in v0.10.1

func CheckTerraform() (string, error)

func FreshOutput

func FreshOutput(remoteState *RemoteState, rootPath string) (map[string]string, error)

func GenerateBackendConfig

func GenerateBackendConfig(remoteState *RemoteState, rootPath string) (string, error)

func Get

func Get(rootPath string) error

func GetBackendConfigFilename

func GetBackendConfigFilename(rootPath string) string

func IsStateEmpty

func IsStateEmpty(rootPath string) (bool, error)

func Output

func Output(rootPath string) (map[string]string, error)

func ReenableRemoteState

func ReenableRemoteState(remoteState *RemoteState, rootPath string) (string, error)

func State added in v0.12.0

func State(rootPath string) (string, error)

Types

type ApplyCommand added in v0.10.1

type ApplyCommand struct {
	TfCommand
}

func (*ApplyCommand) Run added in v0.10.1

func (c *ApplyCommand) Run(args []string) int

type ApplyInput

type ApplyInput struct {
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	Target       string
	Refresh      bool
	Variables    map[string]string
	PlanFilePath string
	XLegacy      bool
}

type ApplyOutput

type ApplyOutput struct {
	ExitCode int
	Stdout   string
	Stderr   string
	Warnings []string
	Outputs  map[string]string
	Diff     *ResourceDiff
}

func Apply

func Apply(input *ApplyInput) (*ApplyOutput, error)

func FreshApply

func FreshApply(input *FreshApplyInput) (*ApplyOutput, error)

type BackendConfig

type BackendConfig struct {
	Terraform []BackendObj `json:"terraform"`
}

type BackendObj

type BackendObj struct {
	Backend []S3Backend `json:"backend"`
}

type CmdOutput

type CmdOutput struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Warnings []string
}

func Cmd

func Cmd(cmdName string, args []string, basePath string, stdoutW, stderrW io.Writer) (*CmdOutput, error)

func Validate

func Validate(rootpath string) (*CmdOutput, error)

type DestroyCommand added in v0.10.1

type DestroyCommand struct {
	TfCommand
}

func (*DestroyCommand) Run added in v0.10.1

func (c *DestroyCommand) Run(args []string) int

type DestroyInput

type DestroyInput struct {
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	Refresh      bool
	Target       string
	Variables    map[string]string
	XLegacy      bool
}

type DestroyOutput

type DestroyOutput struct {
	ExitCode int
	Stdout   string
	Stderr   string
	Warnings []string
	Diff     *ResourceDiff
}

func Destroy

func Destroy(input *DestroyInput) (*DestroyOutput, error)

func FreshDestroy

func FreshDestroy(input *FreshDestroyInput) (*DestroyOutput, error)

type FreshApplyInput

type FreshApplyInput struct {
	RemoteState  *RemoteState
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	Target       string
	Refresh      bool
	PlanFilePath string
	XLegacy      bool
}

type FreshDestroyInput

type FreshDestroyInput struct {
	RemoteState  *RemoteState
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	Refresh      bool
	Target       string
	Variables    map[string]string
	XLegacy      bool
}

type FreshPlanInput

type FreshPlanInput struct {
	RemoteState  *RemoteState
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	PlanFilePath string
	Variables    map[string]string
	Refresh      bool
	Target       string
	Destroy      bool
	XLegacy      bool
}

type GetCommand added in v0.10.1

type GetCommand struct {
	TfCommand
}

func (*GetCommand) Run added in v0.10.1

func (c *GetCommand) Run(args []string) int

type InitCommand added in v0.10.1

type InitCommand struct {
	TfCommand
}

func (*InitCommand) Run added in v0.10.1

func (c *InitCommand) Run(args []string) int

type Meta added in v0.10.1

type Meta struct {
	Color bool           // True if output should be colored
	Ui    *ui.StreamedUi // Ui for output
}

type OutputCommand added in v0.10.1

type OutputCommand struct {
	TfCommand
}

func (*OutputCommand) Run added in v0.10.1

func (c *OutputCommand) Run(args []string) int

type PlanCommand added in v0.10.1

type PlanCommand struct {
	TfCommand
}

func (*PlanCommand) Run added in v0.10.1

func (c *PlanCommand) Run(args []string) int

type PlanInput

type PlanInput struct {
	StdoutWriter io.Writer
	StderrWriter io.Writer
	RootPath     string
	PlanFilePath string
	Variables    map[string]string
	Refresh      bool
	Target       string
	Destroy      bool
	XLegacy      bool
}

type PlanOutput

type PlanOutput struct {
	ExitCode int
	Stdout   string
	Stderr   string
	Warnings []string
	Diff     *PlanResourceDiff
}

func FreshPlan

func FreshPlan(input *FreshPlanInput) (*PlanOutput, error)

func Plan

func Plan(input *PlanInput) (*PlanOutput, error)

type PlanResourceDiff

type PlanResourceDiff struct {
	ToCreate int
	ToRemove int
	ToChange int
}

type RemoteState

type RemoteState struct {
	Backend string
	Config  map[string]string
}

func GetRemoteStateForApp

func GetRemoteStateForApp(rs *RemoteState, namespace, appName string) (*RemoteState, error)

func GetRemoteStateForSlotId

func GetRemoteStateForSlotId(rs *RemoteState, namespace, appName, slotId string) (*RemoteState, error)

type ResourceDiff

type ResourceDiff struct {
	Created int
	Removed int
	Changed int
}

type S3Backend

type S3Backend struct {
	S3 map[string]string `json:"s3"`
}

type StateCommand added in v0.12.0

type StateCommand struct {
	TfCommand
}

func (*StateCommand) Run added in v0.12.0

func (c *StateCommand) Run(args []string) int

type TaintCommand added in v0.10.1

type TaintCommand struct {
	TfCommand
}

func (*TaintCommand) Run added in v0.10.1

func (c *TaintCommand) Run(args []string) int

type TfCommand added in v0.10.1

type TfCommand struct {
	Meta
}

func (*TfCommand) Execute added in v0.10.1

func (c *TfCommand) Execute(args []string) int

func (*TfCommand) Help added in v0.10.1

func (c *TfCommand) Help() string

This shouldn't be seen, but is required by github.com/mitchellh/cli

func (*TfCommand) Synopsis added in v0.10.1

func (c *TfCommand) Synopsis() string

This shouldn't be seen, but is required by github.com/mitchellh/cli

type UntaintCommand added in v0.10.1

type UntaintCommand struct {
	TfCommand
}

func (*UntaintCommand) Run added in v0.10.1

func (c *UntaintCommand) Run(args []string) int

type ValidateCommand added in v0.10.1

type ValidateCommand struct {
	TfCommand
}

func (*ValidateCommand) Run added in v0.10.1

func (c *ValidateCommand) Run(args []string) int

Jump to

Keyboard shortcuts

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