infra

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package infra provides a thin wrapper around the Terraform CLI for provisioning nSelf infrastructure via provider-specific modules (B51/B52).

Status: PLANNED — deferred. Requires UD-12 minor release approval. Terraform modules live in terraform/modules/<provider>/ at the repo root.

Index

Constants

This section is empty.

Variables

View Source
var ErrTerraformNotFound = fmt.Errorf("infra: terraform binary not found; install from https://developer.hashicorp.com/terraform")

ErrTerraformNotFound is returned when the terraform binary is not in PATH.

ValidProviders is the set of supported providers.

Functions

func Apply

func Apply(ctx context.Context, opts ApplyOptions) error

Apply runs `terraform apply` for the given provider module.

func Destroy

func Destroy(ctx context.Context, provider Provider, domain, modulesDir string, autoApprove bool) error

Destroy runs `terraform destroy` for the given provider module.

func Plan

func Plan(ctx context.Context, opts PlanOptions) error

Plan runs `terraform plan` for the given provider module.

Types

type ApplyOptions

type ApplyOptions struct {
	PlanOptions
	AutoApprove bool
}

ApplyOptions holds parameters for terraform apply.

type PlanOptions

type PlanOptions struct {
	Provider    Provider
	Domain      string
	StateBucket string
	ModulesDir  string // defaults to terraform/modules/<provider>
}

PlanOptions holds parameters for terraform plan.

type Provider

type Provider string

Provider is a cloud provider supported by the Terraform modules.

const (
	ProviderAWS          Provider = "aws"
	ProviderGCP          Provider = "gcp"
	ProviderAzure        Provider = "azure"
	ProviderHetzner      Provider = "hetzner"
	ProviderDigitalOcean Provider = "do"
	ProviderLinode       Provider = "linode"
)

Jump to

Keyboard shortcuts

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