state

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(serializable Serializable) (*tfprotov6.DynamicValue, error)

Marshal converts a Serializable state value into a DynamicValue suitable for transporting over the wire in response to the various Terraform callbacks, i.e. PlanResourceChange or ApplyResourceChange The generated value must have the structure as the value received in the request from Terraform, otherwise Terraform will blow up with an error.

func MarshalDelete

func MarshalDelete(serializable Serializable) (*tfprotov6.DynamicValue, error)

MarshalDelete creates a nil Terraform DynamicValue, that indicates that the resource has been deleted.

Types

type Serializable

type Serializable interface {
	Terraform5Type() tftypes.Type
	Terraform5Value() tftypes.Value
	FromTerraform5Value(val tftypes.Value) error
}

type State

type State interface {
	Serializable

	Schema() *tfprotov6.Schema
	Validate(ctx context.Context) error

	// HandleFailure is called when either an apply or plan fails, diag is the tfprotov6.Diagnostic
	// for the failure, providerConfig is the tftypes.Value of the provider configuration.
	HandleFailure(ctx context.Context, diag *tfprotov6.Diagnostic, providerConfig tftypes.Value)
}

Jump to

Keyboard shortcuts

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