tfgen

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tfgen renders deterministic Podplane-managed OpenTofu/Terraform files.

Index

Constants

View Source
const (
	// AWSProviderSource is the registry address of the AWS provider used by cluster infrastructure.
	AWSProviderSource = "hashicorp/aws"
	// AWSProviderVersion is the supported AWS provider version constraint.
	AWSProviderVersion = ">= 6.0"
	// PodplaneProviderSource is the registry address of the Podplane provider.
	PodplaneProviderSource = "podplane/podplane"
	// PodplaneProviderVersion is the supported Podplane provider version constraint.
	PodplaneProviderVersion = ">= 1.2.0"
	// NstanceModuleSource is the registry address of the Nstance AWS module.
	NstanceModuleSource = "nstance-dev/nstance/aws"
	// NstanceModuleVersion is the supported Nstance module version constraint.
	NstanceModuleVersion = "~> 2.0"
)

Variables

This section is empty.

Functions

func TerraformDependencyRoot added in v0.9.0

func TerraformDependencyRoot(moduleVersion string) string

TerraformDependencyRoot renders a minimal root module containing all cluster providers and modules so their complete dependency graph can be resolved. An empty moduleVersion uses the normal version constraint.

func WriteCluster

func WriteCluster(configPath string, cfg *clusterconfig.ClusterConfig, opts ClusterOptions) error

WriteCluster writes managed Terraform files for a cluster config path.

func WriteFiles

func WriteFiles(dir string, files []File) error

WriteFiles writes generated files, adding the Podplane header to Terraform.

func WriteOIDC

func WriteOIDC(dir string, cfg *oidcconfig.Config) error

WriteOIDC writes managed Terraform files for an OIDC config.

Types

type ClusterOptions added in v0.1.2

type ClusterOptions struct {
	DepsMirrorURL     string
	VMConfigManifests []VMConfigManifest
	NstanceModuleDir  string
}

ClusterOptions provides dependency inputs needed to render cluster Terraform.

type File

type File struct {
	Name    string
	Content string
	Type    FileType
}

File is one generated infrastructure file to write.

func GenerateCluster

func GenerateCluster(configPath string, cfg *clusterconfig.ClusterConfig, opts ClusterOptions) ([]File, error)

GenerateCluster renders managed Terraform files for a cluster config path.

func GenerateOIDC

func GenerateOIDC(cfg *oidcconfig.Config) ([]File, error)

GenerateOIDC renders managed Terraform files for an OIDC config.

type FileType added in v0.7.0

type FileType int

FileType identifies the syntax and header behavior of a generated file.

const (
	FileTypeTerraform FileType = iota + 1
	FileTypeJSON
)

type VMConfigManifest added in v0.7.0

type VMConfigManifest struct {
	Kind     string
	Arch     string
	Filename string
	JSON     []byte
}

VMConfigManifest is one pinned vmconfig manifest used by generated Terraform.

Jump to

Keyboard shortcuts

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