Documentation
¶
Overview ¶
Package terraform provides programmatic Terraform execution using terraform-exec.
Index ¶
- Variables
- type Manager
- func (m *Manager) Apply(ctx context.Context, workDir string, envVars map[string]string) (map[string]string, error)
- func (m *Manager) Cleanup(workDir string) error
- func (m *Manager) Destroy(ctx context.Context, workDir string, envVars map[string]string) error
- func (m *Manager) Setup(ctx context.Context, executionID string, tfContentBase64 string) (string, error)
- func (m *Manager) WithLogFields(fields logrus.Fields) *Manager
Constants ¶
This section is empty.
Variables ¶
View Source
var LookPath = func(file string) (string, error) {
return execLookPath(file)
}
LookPath is a variable to allow mocking in tests.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles Terraform operations for pack simulations.
func NewManager ¶
NewManager creates a new Terraform Manager rooted at dataDir. It downloads terraform to <dataDir>/bin/ if not already present, or falls back to local terraform. The terraform binary is downloaded once and cached for all subsequent Manager instances. requestedVersion may be empty to install the latest version.
func NewManagerWithBaseDir ¶
NewManagerWithBaseDir creates a new Manager with a custom base directory.
func (*Manager) Apply ¶
func (m *Manager) Apply(ctx context.Context, workDir string, envVars map[string]string) (map[string]string, error)
Apply runs terraform init + apply and returns the outputs as strings.
Click to show internal directories.
Click to hide internal directories.