terraform

package
v0.0.0-...-628cd2a Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HydroUI

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

func (*HydroUI) Ask

func (h *HydroUI) Ask(string) (string, error)

Ask asks the user for input using the given query. For Hydroform, it always responds "yes" to skip terraform confirmation prompts

func (*HydroUI) AskSecret

func (h *HydroUI) AskSecret(string) (string, error)

AskSecret asks the user for input using the given query, but does not echo the keystrokes to the terminal.

func (*HydroUI) Error

func (h *HydroUI) Error(s string)

Error saves error messages from terraform as an error slice to be retrieved later by Hydroform.

func (*HydroUI) Errors

func (h *HydroUI) Errors() []error

Errors returns any errors or warnings that happened during a terraform command execution

func (*HydroUI) Info

func (h *HydroUI) Info(string)

Info is called for information related to the previous output. In general this may be the exact same as Output, but this gives Ui implementors some flexibility with output formats. Terraform info is ignored in Hydroform.

func (*HydroUI) Output

func (h *HydroUI) Output(string)

Output is called for normal standard output. Terraform output is ignored in Hydroform

func (*HydroUI) Warn

func (h *HydroUI) Warn(s string)

Warn saves warning messages from terraform as an error slice to be retrieved later by Hydroform.

type Option

type Option func(ops *Options)

Option is a function that allows to extensibly configure the terraform operator.

func Persistent

func Persistent() Option

Make files persistent after using terraform

func ToTerraformOptions

func ToTerraformOptions(ops *types.Options) (tfOps []Option)

ToTerraformOptions turns Hydroform options into terraform operator specific options

func Verbose

func Verbose(verbose bool) Option

func WithDataDir

func WithDataDir(dir string) Option

Set a custom directory where all Hydroform files will be stored.

func WithTimeouts

func WithTimeouts(timeouts types.Timeouts) Option

Sets operation timeouts

func WithUI

func WithUI(ui hashiCli.Ui) Option

Set a custom UI for the Meta configuration.

type Options

type Options struct {
	command.Meta
	// Persistent allows to configure if terraform files should stay in the file system or be cleaned up after each operation.
	Persistent bool

	// Timeouts specifies the timeouts of the operations
	Timeouts types.Timeouts

	// Print terraform log for debugging
	Verbose bool
}

Options contains all configuration for the terraform operator

type Terraform

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

Terraform is an Operator.

func New

func New(ops ...Option) *Terraform

New creates a new Terraform operator with the given options

func (*Terraform) Create

func (t *Terraform) Create(p types.ProviderType, cfg map[string]interface{}) (*types.ClusterInfo, error)

Create creates a new cluster for a specific provider based on configuration details. It returns a ClusterInfo object with provider-related information, or an error if cluster provisioning failed.

func (*Terraform) Delete

func (t *Terraform) Delete(info *types.ClusterInfo, p types.ProviderType, cfg map[string]interface{}) error

Delete removes an existing cluster or returns an error if removing the cluster is not possible.

func (*Terraform) Status

func (t *Terraform) Status(info *types.ClusterInfo, p types.ProviderType, cfg map[string]interface{}) (*types.ClusterStatus, error)

Status checks the current state of the cluster from the file

Jump to

Keyboard shortcuts

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