exec

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package exec is the TerraformClient that runs the terraform binary through a CommandRunner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(out []byte) (types.Plan, error)

Parse reads `terraform show -json` output into a Plan: no-op and read actions are dropped; create adds, update changes, delete destroys, and a replacement (delete and create) both adds and destroys.

Types

type Client

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

Client runs terraform.

func New

func New(runner interfaces.CommandRunner) *Client

New returns the Client. It does no I/O.

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, dir, planFile string) error

Apply runs `terraform apply -input=false planFile`.

func (*Client) Init

func (c *Client) Init(ctx context.Context, dir string) error

Init runs `terraform init -input=false`.

func (*Client) Plan

func (c *Client) Plan(ctx context.Context, dir, out string) (types.Plan, error)

Plan runs `terraform plan -input=false -out=out`, then shows the plan.

func (*Client) Show

func (c *Client) Show(ctx context.Context, dir, planFile string) (types.Plan, error)

Show runs `terraform show -json planFile` and parses it.

Jump to

Keyboard shortcuts

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