iacbundle

package
v0.0.0-...-a99bcb5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: OSL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package iacbundle writes the Terraform part of a customer federation bundle. Both bundle builders use it, the API (GET /api/federation/iac?format=bundle) and scripts/generate-federation-iac.go --format bundle, so every bundle ships the out-of-tree modules its Terraform calls and `terraform init` works from the unzipped files (#1431, #1442).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTerraformDir

func AddTerraformDir(zw *zip.Writer, fsys fs.FS, srcDir string, mods []Module) error

AddTerraformDir writes srcDir in fsys to the zip under terraform/, followed by every module in mods, with each module call rewritten to the shipped copy. Hidden files and directories (.terraform.lock.hcl, a local .terraform/) are left out, as go:embed leaves them out of the API's copy. A module that no .tf file calls is an error: the rewrite would otherwise silently stop applying after the call is moved.

func UnresolvedLocalModules

func UnresolvedLocalModules(files map[string][]byte) []string

UnresolvedLocalModules returns "file: source" for every local module source in a bundle's .tf files (keyed by their path in the zip) that does not point at a directory of .tf files inside the bundle. terraform init fails on each of them with "Unreadable module directory" (#1431). Both bundle builders' tests run their output through it.

Types

type Module

type Module struct {
	RepoSource string // the module source as written in the repo's .tf files
	FS         fs.FS  // where the module's files are
	Dir        string // the module's directory in FS
	ZipDir     string // its directory in the zip, relative to terraform/
}

Module is a Terraform module that a federation bundle calls from outside its own Terraform directory. The bundle ships a copy of it under terraform/<ZipDir> and points the call at that copy.

func ExtraModules

func ExtraModules(target string) []Module

ExtraModules returns the out-of-tree modules the target's bundle calls. Only the Azure bundle has one: the custom reservation-purchaser role, shared with the host side and checked by scripts/check-azure-role-parity.sh.

Jump to

Keyboard shortcuts

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