genconfig

package
v1.5.0-beta2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package genconfig implements config generation from provided state values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateResourceContents

func GenerateResourceContents(addr addrs.AbsResourceInstance,
	schema *configschema.Block,
	pc addrs.LocalProviderConfig,
	stateVal cty.Value) (string, tfdiags.Diagnostics)

GenerateResourceContents generates HCL configuration code for the provided resource and state value.

If you want to generate actual valid Terraform code you should follow this call up with a call to WrapResourceContents, which will place a Terraform resource header around the attributes and blocks returned by this function.

func MaybeWriteGeneratedConfig

func MaybeWriteGeneratedConfig(plan *plans.Plan, out string) (wroteConfig bool, diags tfdiags.Diagnostics)

func ValidateTargetFile

func ValidateTargetFile(out string) tfdiags.Diagnostics

func WrapResourceContents

func WrapResourceContents(addr addrs.AbsResourceInstance, config string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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