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

planfile

package
v1.233.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package planfile binds policy evaluation to saved Terraform artifacts. It does not collect CI facts, execute hooks or coordinate other runs. Its caller can supply approval verification through ResolveApprovals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard struct {
	ResolveApprovals func(context.Context, *policy.Request, policy.Decision) (policy.Decision, error)
	Subject          *policy.Subject
	Engine           *policy.Engine
	Rules            []policy.Rule
	Show             process.Runner
	CI               *policy.CISnapshot
}

Guard evaluates rules using the configured pure engine. Show uses an isolated process runner so raw JSON never passes through terminal masking or CI capture.

func (*Guard) Execute

func (g *Guard) Execute(ctx context.Context, invocation *Invocation, run func([]string) process.Result) (process.Result, error)

Execute runs one governed plan/apply. The callback preserves the existing command executor's streams/retries. A separate gate error must NEVER be remapped as a Terraform exit code or treated as best-effort reporting.

type Invocation

type Invocation struct {
	Command string
	Args    []string
	Dir     string
	Env     []string
}

Invocation is the prepared Terraform process, not a command to re-enter Atmos. Args must contain an explicit -out for plan or a final saved-plan argument for apply.

Jump to

Keyboard shortcuts

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