package
3.0.0+incompatible
Repository: https://github.com/eitol/terraform-internals.git
Documentation: pkg.go.dev
# Functions
CheckCoreVersionRequirements visits each of the modules in the given configuration tree and verifies that any given Core version constraints match with the version of Terraform Core that is being used.
DefaultVariableValues returns an InputValues map representing the default values specified for variables in the given configuration map.
EvalDataForInstanceKey constructs a suitable InstanceKeyEvalData for evaluating in a context that has the given instance key.
GraphDot returns the dot formatting of a visual representation of the given Terraform graph.
GraphTransformMulti combines multiple graph transformers into a single GraphTransformer that runs all the individual graph transformers.
InputValuesFromCaller turns the given map of naked values into an InputValues that attributes each value to "a caller", using the source type ValueFromCaller.
NewContext creates a new Context structure.
NewNodeAbstractResource creates an abstract resource graph node for the given absolute resource address.
NewNodeAbstractResourceInstance creates an abstract resource instance graph node for the given absolute resource instance address.
NewReferenceMap is used to create a new reference map for the given set of vertices.
NewSemaphore creates a semaphore that allows up to a given limit of simultaneous acquisitions.
ReferencesFromConfig returns the references that a configuration has based on the interpolated variables in a configuration.
ValidateGraphBuilder creates the graph for the validate operation.
# Constants
HookActionContinue continues with processing as usual.
HookActionHalt halts immediately: no more hooks are processed and the action that Terraform was about to take is cancelled.
InputModeProvider asks for provider variables.
InputModeStd is the standard operating mode and asks for both variables and providers.
ValueFromAutoFile indicates that a value came from a "values file", like a .tfvars file, that was implicitly loaded by naming convention.
ValueFromCaller indicates that the value was explicitly overridden by a caller to Context.SetVariable after the context was constructed.
ValueFromCLIArg indicates that the value was provided directly in a CLI argument.
ValueFromConfig indicates that a value came from a .tf or .tf.json file, e.g.
ValueFromEnvVar indicates that the value was provided via an environment variable.
ValueFromInput indicates that the value was provided at an interactive input prompt.
ValueFromNamedFile indicates that a value came from a named "values file", like a .tfvars file, that was passed explicitly on the command line (e.g.
ValueFromPlan indicates that the value was retrieved from a stored plan.
ValueFromUnknown is the zero value of ValueSourceType and is not valid.
# Variables
No description provided by the author
EvalDataForNoInstanceKey is a value of InstanceKeyData that sets no instance key values at all, suitable for use in contexts where no keyed instance is relevant.
# Structs
ApplyGraphBuilder implements GraphBuilder and is responsible for building a graph for applying a Terraform diff.
AttachDependenciesTransformer records all resource dependencies for each instance, and attaches the addresses to the node itself.
AttachResourceConfigTransformer goes through the graph and attaches resource configuration structures to nodes that implement GraphNodeAttachManagedResourceConfig or GraphNodeAttachDataResourceConfig.
AttachSchemaTransformer finds nodes that implement GraphNodeAttachResourceSchema, GraphNodeAttachProviderConfigSchema, or GraphNodeAttachProvisionerSchema, looks up the needed schemas for each and then passes them to a method implemented by the node.
AttachStateTransformer goes through the graph and attaches state to nodes that implement the interfaces above.
BasicGraphBuilder is a GraphBuilder that builds a graph out of a series of transforms and (optionally) validates the graph is a valid structure.
BuiltinEvalContext is an EvalContext implementation that is used by Terraform by default.
No description provided by the author
CBDEdgeTransformer modifies the edges of CBD nodes that went through the DestroyEdgeTransformer to have the right dependencies.
CloseProviderTransformer is a GraphTransformer that adds nodes to the graph that will close open provider connections that aren't needed anymore.
CloseRootModuleTransformer is a GraphTransformer that adds a root to the graph.
ConfigTransformer is a GraphTransformer that adds all the resources from the configuration to the graph.
Context represents all the context that Terraform needs in order to perform operations on infrastructure.
No description provided by the author
ContextGraphWalker is the GraphWalker implementation used with the Context struct to walk and evaluate the graph.
ContextMeta is metadata about the running context.
ContextOpts are the user-configurable options to create a context with NewContext.
DestroyEdgeTransformer is a GraphTransformer that creates the proper references for destroy resources.
DestroyPlanGraphBuilder implements GraphBuilder and is responsible for planning a pure-destroy.
DiffTransformer is a GraphTransformer that adds graph nodes representing each of the resource changes described in the given Changes object.
EvalGraphBuilder implements GraphBuilder and constructs a graph suitable for evaluating in-memory values (input variables, local values, output values) in the state without any other side-effects.
No description provided by the author
Evaluator provides the necessary contextual data for evaluating expressions for a particular walk operation.
ForcedCBDTransformer detects when a particular CBD-able graph node has dependencies with another that has create_before_destroy set that require it to be forced on, and forces it on.
Graph represents the graph that Terraform uses to represent resources and their dependencies.
ImportGraphBuilder implements GraphBuilder and is responsible for building a graph for importing resources into Terraform.
ImportOpts are used as the configuration for Import.
ImportStateTransformer is a GraphTransformer that adds nodes to the graph to represent the imports we want to do for resources.
ImportTarget is a single resource to import.
InputOpts are options for asking for input.
InputValue represents a value for a variable in the root module, provided as part of the definition of an operation.
LocalTransformer is a GraphTransformer that adds all the local values from the configuration to the graph.
MissingProviderTransformer is a GraphTransformer that adds to the graph a node for each default provider configuration that is referenced by another node but not already present in the graph.
MockEvalContext is a mock version of EvalContext that can be used for tests.
MockHook is an implementation of Hook that can be used for tests.
MockProvider implements providers.Interface but mocks out all the calls for testing purposes.
MockProvisioner implements provisioners.Interface but mocks out all the calls for testing purposes.
MockUIInput is an implementation of UIInput that can be used for tests.
MockUIOutput is an implementation of UIOutput that can be used for tests.
ModuleExpansionTransformer is a GraphTransformer that adds graph nodes representing the possible expansion of each module call in the configuration, and ensures that any nodes representing objects declared within a module are dependent on the expansion node so that they will be visited only after the module expansion has been decided.
ModuleVariableTransformer is a GraphTransformer that adds all the variables in the configuration to the graph.
NilHook is a Hook implementation that does nothing.
NodeAbstractProvider represents a provider that has no associated operations.
NodeAbstractResource represents a resource that has no associated operations.
NodeAbstractResourceInstance represents a resource instance with no associated operations.
NodeApplyableOutput represents an output that is "applyable": it is ready to be applied.
NodeApplyableProvider represents a provider during an apply.
NodeApplyableResource represents a resource that is "applyable": it may need to have its record in the state adjusted to match configuration.
NodeApplyableResourceInstance represents a resource instance that is "applyable": it is ready to be applied and is represented by a diff.
NodeDestroyableDataResourceInstance represents a resource that is "destroyable": it is ready to be destroyed.
NodeDestroyableOutput represents an output that is "destroyable": its application will remove the output from the state.
NodeDestroyDeposedResourceInstanceObject represents deposed resource instance objects during apply.
NodeDestroyResourceInstance represents a resource instance that is to be destroyed.
NodeEvalableProvider represents a provider during an "eval" walk.
NodeLocal represents a named local value in a particular module.
NodePlanDeposedResourceInstanceObject represents deposed resource instance objects during plan.
NodePlanDestroyableResourceInstance represents a resource that is ready to be planned for destruction.
NodePlannableResource represents a resource that is "plannable": it is ready to be planned in order to create a diff.
NodePlannableResourceInstance represents a _single_ resource instance that is plannable.
NodePlannableResourceInstanceOrphan represents a resource that is "applyable": it is ready to be applied and is represented by a diff.
NodeRootVariable represents a root variable input.
NodeValidatableResource represents a resource that is used for validation only.
NullGraphWalker is a GraphWalker implementation that does nothing.
OrphanOutputTransformer finds the outputs that aren't present in the given config that are in the state and adds them to the graph for deletion.
OrphanResourceInstanceCountTransformer is a GraphTransformer that adds orphans for an expanded count to the graph.
OrphanResourceInstanceTransformer is a GraphTransformer that adds orphaned resource instances to the graph.
OutputTransformer is a GraphTransformer that adds all the outputs in the configuration to the graph.
PlanGraphBuilder implements GraphBuilder and is responsible for building a graph for planning (creating a Terraform Diff).
PlanOpts are the various options that affect the details of how Terraform will build a plan.
PrefixUIInput is an implementation of UIInput that prefixes the ID with a string, allowing queries to be namespaced.
ProviderConfigTransformer adds all provider nodes from the configuration and attaches the configs.
ProviderSchema represents the schema for a provider's own configuration and the configuration for some or all of its resources and data sources.
ProviderTransformer is a GraphTransformer that maps resources to providers within the graph.
ProvisionerUIOutput is an implementation of UIOutput that calls a hook for the output so that the hooks can handle it.
PruneProviderTransformer removes any providers that are not actually used by anything, and provider proxies.
ReferenceTransformer is a GraphTransformer that connects all the nodes that reference each other in order to form the proper ordering.
RemovedModuleTransformer implements GraphTransformer to add nodes indicating when a module was removed from the configuration.
ResourceCountTransformer is a GraphTransformer that expands the count out for a specific resource.
RootTransformer is a GraphTransformer that adds a root to the graph.
RootVariableTransformer is a GraphTransformer that adds all the root variables to the graph.
Schemas is a container for various kinds of schema that Terraform needs during processing.
StateTransformer is a GraphTransformer that adds the elements of the state to the graph.
TargetsTransformer is a GraphTransformer that, when the user specifies a list of resources to target, limits the graph to only those resources and their dependencies.
TransitiveReductionTransformer is a GraphTransformer that performs finds the transitive reduction of the graph.
VertexTransformer is a GraphTransformer that transforms vertices using the GraphVertexTransformers.
# Interfaces
EvalContext is the interface that is given to eval nodes to execute.
GraphBuilder is an interface that can be implemented and used with Terraform to build the graph that Terraform walks.
No description provided by the author
GraphNodeAttachProvider is an interface that must be implemented by nodes that want provider configurations attached.
GraphNodeAttachProviderConfigSchema is an interface implemented by node types that need a provider configuration schema attached.
GraphNodeAttachProviderMetaConfigs is an interface that must be implemented by nodes that want provider meta configurations attached.
GraphNodeAttachProvisionerSchema is an interface implemented by node types that need one or more provisioner schemas attached.
GraphNodeAttachResourceConfig is an interface that must be implemented by nodes that want resource configurations attached.
GraphNodeAttachResourceSchema is an interface implemented by node types that need a resource schema attached.
GraphNodeAttachResourceState is an interface that can be implemented to request that a ResourceState is attached to the node.
GraphNodeCloseProvider is an interface that nodes that can be a close provider must implement.
GraphNodeConfigResource is implemented by any nodes that represent a resource.
GraphNodeCreator must be implemented by nodes that create OR update resources.
No description provided by the author
GraphNodeDeposer is an optional interface implemented by graph nodes that might create a single new deposed object for a specific associated resource instance, allowing a caller to optionally pre-allocate a DeposedKey for it.
GraphNodeDestroyer must be implemented by nodes that destroy resources.
GraphNodeDestroyerCBD must be implemented by nodes that might be create-before-destroy destroyers, or might plan a create-before-destroy action.
GraphNodeDynamicExpandable is an interface that nodes can implement to signal that they can be expanded at eval-time (hence dynamic).
GraphNodeExecutable is the interface that graph nodes must implement to enable execution.
GraphNodeModuleInstance says that a node is part of a graph with a different path, and the context should be adjusted accordingly.
GraphNodeModulePath is implemented by all referenceable nodes, to indicate their configuration path in unexpanded modules.
GraphNodeProvider is an interface that nodes that can be a provider must implement.
GraphNodeProviderConsumer is an interface that nodes that require a provider must implement.
GraphNodeProvisionerConsumer is an interface that nodes that require a provisioner must implement.
GraphNodeReferenceable must be implemented by any node that represents a Terraform thing that can be referenced (resource, module, etc.).
GraphNodeReferenceOutside is an interface that can optionally be implemented.
GraphNodeReferencer must be implemented by nodes that reference other Terraform items and therefore depend on them.
GraphNodeResourceInstance is implemented by any nodes that represent a resource instance.
GraphNodeTargetable is an interface for graph nodes to implement when they need to be told about incoming targets.
GraphTransformer is the interface that transformers implement.
GraphVertexTransformer is an interface that transforms a single Vertex within with graph.
GraphWalker is an interface that can be implemented that when used with Graph.Walk will invoke the given callbacks under certain events.
Hook is the interface that must be implemented to hook into various parts of Terraform, allowing you to inspect or change behavior at runtime.
UIInput is the interface that must be implemented to ask for input from this user.
UIOutput is the interface that must be implemented to output data to the end user.
# Type aliases
No description provided by the author
ConcreteProviderNodeFunc is a callback type used to convert an abstract provider to a concrete one of some type.
ConcreteResourceInstanceDeposedNodeFunc is a callback type used to convert an abstract resource instance to a concrete one of some type that has an associated deposed object key.
ConcreteResourceInstanceNodeFunc is a callback type used to convert an abstract resource instance to a concrete one of some type.
ConcreteResourceNodeFunc is a callback type used to convert an abstract resource to a concrete one of some type.
HookAction is an enum of actions that can be taken as a result of a hook callback.
InputMode defines what sort of input will be asked for when Input is called on Context.
InputValues is a map of InputValue instances.
InstanceKeyEvalData is the old name for instances.RepetitionData, aliased here for compatibility.
ReferenceMap is a structure that can be used to efficiently check for references on a graph, mapping internal reference keys (as produced by the mapKey method) to one or more vertices that are identified by each key.
ValueSourceType describes what broad category of source location provided a particular value.