Compile your .iac source to Go — for teams that prefer static typing and fast compilation.
Go’s appeal for infrastructure code is the same as its appeal for systems code: static typing that catches errors at compile time rather than runtime, fast compilation, a single static binary with no runtime dependencies, and explicit error handling that makes failure modes clear and auditable. Teams building platform tooling in Go — controllers, operators, CLIs — often find it natural to run their infrastructure in Go too. Set runtime = "go" in ubx.iac and ubx generates a main.go and go.mod — idiomatic Go code using the Pulumi Go SDK. The .iac source is still identical to tutorials 42 and 43. The generated Go is more verbose than the TypeScript or Python equivalents, but it’s also the most explicit: every type is declared, every error is handled, and the dependency graph is visible in the code structure.
Go runtime produces a fully static binary — no Node.js, no Python runtime, no virtualenv. In containerised CI environments where you control the base image, a Go Pulumi program has the smallest footprint and the most predictable execution environment.
The Go version is more verbose but completely explicit — every operation, every error, every export is visible. ubx generates idiomatic Go that Go developers will recognise.