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 ¶
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 ¶
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 ¶
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.