Documentation
¶
Index ¶
- type Client
- type Printer
- func (p *Printer) Apply(ctx context.Context) error
- func (p *Printer) GoString() string
- func (p *Printer) Init(ctx context.Context) error
- func (p *Printer) Plan(ctx context.Context) (bool, error)
- func (p *Printer) SetEnv(map[string]string) error
- func (p *Printer) SetStdout(w io.Writer)
- func (p *Printer) Validate(ctx context.Context) error
- type PrinterConfig
- type TerraformCLI
- func (t *TerraformCLI) Apply(ctx context.Context) error
- func (t *TerraformCLI) GoString() string
- func (t *TerraformCLI) Init(ctx context.Context) error
- func (t *TerraformCLI) Plan(ctx context.Context) (bool, error)
- func (t *TerraformCLI) SetEnv(env map[string]string) error
- func (t *TerraformCLI) SetStdout(w io.Writer)
- func (t *TerraformCLI) Validate(ctx context.Context) error
- type TerraformCLIConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Set the environment for the client SetEnv(map[string]string) error // Set the standard out for the client SetStdout(w io.Writer) // Init initializes the client and environment Init(ctx context.Context) error // Apply makes a request to apply changes Apply(ctx context.Context) error // Plan makes a request to generate a plan of proposed changes Plan(ctx context.Context) (bool, error) // Validate verifies that the generated configurations are valid Validate(ctx context.Context) error // GoString defines the printable version of the client GoString() string }
Client describes the interface for a driver's client that interacts with network infrastructure.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer is a fake client that only logs out actions. Intended to mirror TerraformCLI client and to be used for development only
func NewPrinter ¶
func NewPrinter(config *PrinterConfig) (*Printer, error)
NewPrinter creates a new client
type PrinterConfig ¶
PrinterConfig configures the log client
type TerraformCLI ¶
type TerraformCLI struct {
// contains filtered or unexported fields
}
TerraformCLI is the client that wraps around terraform-exec to execute Terraform cli commands
func NewTerraformCLI ¶
func NewTerraformCLI(config *TerraformCLIConfig) (*TerraformCLI, error)
NewTerraformCLI creates a terraform-exec client and configures and initializes a new Terraform client
func (*TerraformCLI) Apply ¶
func (t *TerraformCLI) Apply(ctx context.Context) error
Apply executes the cli command `terraform apply` for a given workspace
func (*TerraformCLI) GoString ¶
func (t *TerraformCLI) GoString() string
GoString defines the printable version of this struct.
func (*TerraformCLI) Init ¶
func (t *TerraformCLI) Init(ctx context.Context) error
Init initializes by executing the cli command `terraform init` and `terraform workspace new <name>`
func (*TerraformCLI) Plan ¶
func (t *TerraformCLI) Plan(ctx context.Context) (bool, error)
Plan executes the cli command `terraform plan` for a given workspace
func (*TerraformCLI) SetEnv ¶
func (t *TerraformCLI) SetEnv(env map[string]string) error
SetEnv sets the environment for the Terraform workspace
func (*TerraformCLI) SetStdout ¶
func (t *TerraformCLI) SetStdout(w io.Writer)
SetStdout sets the standard out for Terraform