Documentation ¶
Overview ¶
Package genconfig implements config generation from provided state values.
Index ¶
- func GenerateResourceContents(addr addrs.AbsResourceInstance, schema *configschema.Block, ...) (string, tfdiags.Diagnostics)
- func ShouldWriteConfig(out string) bool
- func ValidateTargetFile(out string) (diags tfdiags.Diagnostics)
- func WrapResourceContents(addr addrs.AbsResourceInstance, config string) string
- type Change
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 OpenTofu code you should follow this call up with a call to WrapResourceContents, which will place an OpenTofu resource header around the attributes and blocks returned by this function.
func ShouldWriteConfig ¶
func ValidateTargetFile ¶
func ValidateTargetFile(out string) (diags tfdiags.Diagnostics)
func WrapResourceContents ¶
func WrapResourceContents(addr addrs.AbsResourceInstance, config string) string
Types ¶
Click to show internal directories.
Click to hide internal directories.