varfile

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 4 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 varfile provides a generator for Terraform variable files (.tfvars.json).

Index

Constants

View Source
const (
	// Name is the unique identifier for this generator.
	Name = "varfile"
)

Variables

This section is empty.

Functions

func ConstructFilename

func ConstructFilename(genCtx *generator.GeneratorContext) string

ConstructFilename constructs the dynamic varfile name based on the context. This follows the pattern: {context}-{component}.terraform.tfvars.json or: {context}-{folder}-{component}.terraform.tfvars.json if folder prefix exists.

Types

type Generator

type Generator struct{}

Generator generates Terraform variable files (.tfvars.json).

func (*Generator) DefaultFilename

func (g *Generator) DefaultFilename() string

DefaultFilename returns the default output filename. Note: For varfiles, the actual filename is dynamically constructed based on component and stack context. This returns a placeholder that should be overridden by the calling code.

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, genCtx *generator.GeneratorContext) (map[string]any, error)

Generate produces the varfile content. For varfiles, the content is simply the VarsSection map.

func (*Generator) Name

func (g *Generator) Name() string

Name returns the unique identifier for this generator.

func (*Generator) ShouldGenerate

func (g *Generator) ShouldGenerate(genCtx *generator.GeneratorContext) bool

ShouldGenerate returns true if the VarsSection has data.

func (*Generator) Validate

func (g *Generator) Validate(genCtx *generator.GeneratorContext) error

Validate checks if the generator context has required data.

Jump to

Keyboard shortcuts

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