tfengine

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package tfengine implements the Terraform Engine.

Index

Constants

View Source
const Schema = `` /* 3738-byte string literal not displayed */

Schema is the Terraform engine input schema. TODO(https://github.com/golang/go/issues/35950): Move this to its own file.

Variables

This section is empty.

Functions

func ConvertToLocalBackend

func ConvertToLocalBackend(path string) error

ConvertToLocalBackend converts all the Terraform backend blocks to "local". path should be a path to the root of the configs generated by the Engine.

func Run

func Run(confPath, outPath string, opts *Options) error

Run executes the main tfengine logic.

Types

type Config

type Config struct {
	// Optional constraint on the binary version required for this config.
	// Syntax: https://www.terraform.io/docs/configuration/version-constraints.html
	Version string `hcl:"version,optional" json:"version,omitempty"`

	// HCL decoder can't unmarshal into map[string]interface{},
	// so make it unmarshal to a cty.Value and manually convert to map.
	// TODO(https://github.com/hashicorp/hcl/issues/291): Remove the need for DataCty.
	DataCty *cty.Value             `hcl:"data,optional" json:"-"`
	Data    map[string]interface{} `json:"data,omitempty"`

	SchemaCty *cty.Value             `hcl:"schema,optional" json:"-"`
	Schema    map[string]interface{} `json:"schema,omitempty"`

	Templates []*templateInfo `hcl:"template,block" json:"template,omitempty"`
}

Config is the user supplied config for the engine. HCL struct tags are documented at https://pkg.go.dev/github.com/hashicorp/hcl2/gohcl.

func (*Config) Init

func (c *Config) Init() error

Init initializes and validates the config.

type Options added in v0.1.1

type Options struct {
	Format          bool
	AddLicenses     bool
	CacheDir        string
	ShowUnmanaged   bool
	DeleteUnmanaged bool

	// Leave empty to generate all templates.
	WantedTemplates map[string]bool
}

Options is the options for tfengine execution.

Jump to

Keyboard shortcuts

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