package
0.9.4
Repository: https://github.com/gerbenjacobs/terraform.git
Documentation: pkg.go.dev

# README

Terraform Helper Lib: schema

The schema package provides a high-level interface for writing resource providers for Terraform.

If you're writing a resource provider, we recommend you use this package.

The interface exposed by this package is much friendlier than trying to write to the Terraform API directly. The core Terraform API is low-level and built for maximum flexibility and control, whereas this library is built as a framework around that to more easily write common providers.

# Functions

CopySet returns a copy of another set.
DataSourceResourceShim takes a Resource instance describing a data source (with a Read implementation and a Schema, at least) and returns a new Resource instance with additional Create and Delete implementations that allow the data source to be used as a resource.
could be time.Duration, int64 or float64.
EnvDefaultFunc is a helper function that returns the value of the given environment variable, if one exists, or the default value otherwise.
FromContextBackendConfig extracts a ResourceData with the configuration from the context.
HashResource hashes complex structures that are described using a *Resource.
HashSchema hashes values that are described using a *Schema.
HashString hashes strings.
ImportStatePassthrough is an implementation of StateFunc that can be used to simply pass the ID directly through.
MultiEnvDefaultFunc is a helper function that returns the value of the first environment variable in the given list that returns a non-empty value.
NewSet is a convenience method for creating a new set with the given items.
Noop is a convenience implementation of resource function which takes no action and returns no error.
RemoveFromState is a convenience implementation of a resource function which sets the resource ID to empty string (to remove it from state) and returns no error.
SerializeValueForHash appends a serialization of the given resource config to the given buffer, guaranteeing deterministic results given the same value and schema.
No description provided by the author
TestResourceDataRaw creates a ResourceData from a raw configuration map.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

This returns a *ResourceData for the config information.
This returns a *ResourceData for the connection information.
This returns a terraform.UIOutput.
This returns the raw InstanceState passed to Apply.

# Structs

Backend represents a partial backend.Backend implementation and simplifies the creation of configuration loading and validation.
ConfigFieldReader reads fields out of an untyped map[string]string to the best of its ability.
DiffFieldReader reads fields out of a diff structures.
FieldReadResult encapsulates all the resulting data from reading a field.
MapFieldReader reads fields out of an untyped map[string]string to the best of its ability.
MapFieldWriter writes data into a single map[string]string structure.
MultiLevelFieldReader reads from other field readers, merging their results along the way in a specific order.
Provider represents a resource provider in Terraform, and properly implements all of the ResourceProvider API.
Provisioner represents a resource provisioner in Terraform and properly implements all of the ResourceProvisioner API.
Resource represents a thing in Terraform that has a set of configurable attributes and a lifecycle (create, read, update, delete).
ResourceData is used to query and set the attributes of a resource.
ResourceImporter defines how a resource is imported in Terraform.
No description provided by the author
Schema is used to describe the structure of a value.
Set is a set data structure that is returned for elements of type TypeSet.

# Interfaces

Equal is an interface that checks for deep equality between two objects.
FieldReaders are responsible for decoding fields out of data into the proper typed representation.
FieldWriters are responsible for writing fields by address into a proper typed representation.
MapReader is an interface that is given to MapFieldReader for accessing a "map".

# Type aliases

BasicMapReader implements MapReader for a single map.
ConfigureFunc is the function used to configure a Provider.
See Resource documentation.
See Resource documentation.
See Resource documentation.
MultiMapReader reads over multiple maps, preferring keys that are founder earlier (lower number index) vs.
See Resource documentation.
SchemaDefaultFunc is a function called to return a default value for a field.
SchemaDiffSuppresFunc is a function which can be used to determine whether a detected diff on a schema element is "valid" or not, and suppress it from the plan if necessary.
SchemaSetFunc is a function that must return a unique ID for the given element.
SchemaStateFunc is a function used to convert some type to a string to be stored in the state.
SchemaValidateFunc is a function used to validate a single field in the schema.
StateFunc is the function called to import a resource into the Terraform state.
See Resource documentation.
See Resource documentation.
ValueType is an enum of the type that can be represented by a schema.