package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Functions
DiagnosticOriginatesFromCheckRule checks if the provided diagnostic contains a CheckRule as ExtraInfo and returns that CheckRule and true if it does.
No description provided by the author
ImpliedMoveStatementEndpoint is a special constructor for MoveEndpointInModule which is suitable only for constructing "implied" move statements, which means that we inferred the statement automatically rather than building it from an explicit block in the configuration.
ImpliedProviderForUnqualifiedType represents the rules for inferring what provider FQN a user intended when only a naked type name is available.
InstanceKeyLess returns true if the first given instance key i should sort before the second key j, and false otherwise.
No description provided by the author
IsProviderPartNormalized compares a given string to the result of ParseProviderPart(string).
No description provided by the author
No description provided by the author
No description provided by the author
MustParseProviderPart is a wrapper around ParseProviderPart that panics if it returns an error.
MustParseProviderSourceString is a wrapper around ParseProviderSourceString that panics if it returns an error.
NewBuiltInProvider returns the address of a "built-in" provider.
No description provided by the author
NewDefaultLocalProviderConfig returns the address of the default (un-aliased) configuration for the provider with the given local type name.
NewDefaultProvider returns the default address of a HashiCorp-maintained, Registry-hosted provider.
NewDeposedKey generates a pseudo-random deposed key.
No description provided by the author
NewLegacyProvider returns a mock address for a provider.
NewProvider constructs a provider address from its parts, and normalizes the namespace and type parts to lowercase using unicode case folding rules so that resulting addrs.Provider values can be compared using standard Go equality rules (==).
ObjectInPartialExpandedModule is a constructor for [InPartialExpandedModule] that's here primarily just to benefit from function type parameter inference to avoid manually writing out type T when constructing such a value.
No description provided by the author
No description provided by the author
ParseAbsProviderConfig parses the given traversal as an absolute provider configuration address.
ParseAbsProviderConfigStr is a helper wrapper around ParseAbsProviderConfig that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParseAbsResource attempts to interpret the given traversal as an absolute resource address, using the same syntax as expected by ParseTarget.
ParseAbsResourceInstance attempts to interpret the given traversal as an absolute resource instance address, using the same syntax as expected by ParseTarget.
ParseAbsResourceInstanceStr is a helper wrapper around ParseAbsResourceInstance that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParseAbsResourceStr is a helper wrapper around ParseAbsResource that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParseCheckableStr attempts to parse the given string as a Checkable address of the given kind.
ParseDeposedKey parses a string that is expected to be a deposed key, returning an error if it doesn't conform to the expected syntax.
ParseInstanceKey returns the instance key corresponding to the given value, which must be known and non-null.
ParseLegacyAbsProviderConfig parses the given traversal as an absolute provider address in the legacy form used by Terraform v0.12 and earlier.
No description provided by the author
No description provided by the author
ParseModuleInstanceStr is a helper wrapper around ParseModuleInstance that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParseMoveEndpoint attempts to interpret the given traversal as a "move endpoint" address, which is a relative path from the module containing the traversal to a movable object in either the same module or in some child module.
ParsePartialExpandedModule parses a module address traversal and returns a PartialExpandedModule representing the known and unknown parts of the address.
ParsePartialExpandedResource parses a resource address traversal and returns a PartialExpandedResource representing the known and unknown parts of the address.
ParsePartialResourceInstance attempts to interpret the given traversal as a partial absolute resource instance address, using the same syntax as expected by ParsePartialTarget.
ParsePartialResourceInstanceStr is a helper wrapper around ParsePartialResourceInstance that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParsePartialTarget is like ParseTarget, but it allows the given traversal to support the [*] wildcard syntax for resource instances.
ParseProviderPart processes an addrs.Provider namespace or type string provided by an end-user, producing a normalized version if possible or an error if the string contains invalid characters.
ParseProviderSourceString parses a value of the form expected in the "source" argument of a required_providers entry and returns the corresponding fully-qualified provider address.
ParseRef attempts to extract a referencable address from the prefix of the given traversal, which must be an absolute traversal or this function will panic.
ParseRefFromTestingScope adds check blocks and outputs into the available references returned by ParseRef.
ParseRefStr is a helper wrapper around ParseRef that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
ParseRefStrFromTestingScope matches ParseRefStr except it supports the references supported by ParseRefFromTestingScope.
No description provided by the author
ParseTarget attempts to interpret the given traversal as a targetable address.
ParseTargetStr is a helper wrapper around ParseTarget that takes a string and parses it with the HCL native syntax traversal parser before interpreting it.
SetSortedNatural returns a slice containing the elements of the given set sorted into their "natural" order, as defined by the type's method "Less".
UnifyMoveEndpoints takes a pair of MoveEndpoint objects representing the "from" and "to" addresses in a moved block, and returns a pair of MoveEndpointInModule addresses guaranteed to be of the same dynamic type that represent what the two MoveEndpoint addresses refer to.
# Constants
No description provided by the author
No description provided by the author
BuiltInProviderHost is the pseudo-hostname used for the "built-in" provider namespace.
BuiltInProviderNamespace is the provider namespace used for "built-in" providers.
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
DataResourceMode indicates a data resource, as defined by "data" blocks in configuration.
DefaultModuleRegistryHost is the hostname used for registry-based module source addresses that do not have an explicit hostname.
DefaultProviderRegistryHost is the hostname used for provider addresses that do not have an explicit hostname.
EphemeralResourceMode indicates an ephemeral resource, as defined by "ephemeral" blocks in configuration.
No description provided by the author
No description provided by the author
No description provided by the author
InvalidResourceMode is the zero value of ResourceMode and is not a valid resource mode.
LegacyProviderNamespace is the special string used in the Namespace field of type Provider to mark a legacy provider address.
ManagedResourceMode indicates a managed resource, as defined by "resource" blocks in configuration.
No description provided by the author
No description provided by the author
MoveEndpointModule indicates that a move endpoint either refers to an individual module instance or to all instances of a particular module call.
MoveEndpointResource indicates that a move endpoint either refers to an individual resource instance or to all instances of a particular resource.
No description provided by the author
NotDeposed is a special invalid value of DeposedKey that is used to represent the absense of a deposed key, typically when referring to the "current" object for a particular resource instance.
No description provided by the author
RemoveTargetModule indicates that a remove target refers to all instances of a particular module call.
RemoveTargetResource indicates that a remove target refers to all instances of a particular resource.
ResourceInstancePhaseDestroy represents the "destroy" phase of a resource instance.
ResourceInstancePhaseDestroyCBD is similar to ResourceInstancePhaseDestroy but is used for resources that have "create_before_destroy" set, thus requiring a different dependency ordering.
No description provided by the author
No description provided by the author
Self is the address of the special object "self" that behaves as an alias for a containing object currently in scope.
No description provided by the author
UnknownKeyType is a placeholder key type for situations where Terraform doesn't yet know which key type to use.
# Variables
NoKey represents the absense of an InstanceKey, for the single instance of a configuration object that does not use "count" or "for_each" at all.
RootModule is the module address representing the root of the static module call tree, which is also the zero value of Module.
RootModuleInstance is the module instance address representing the root module, which is also the zero value of ModuleInstance.
WildcardKey represents the "unknown" value of an InstanceKey.
# Structs
AbsCheck is an absolute address for a check block under a given module path.
AbsInputVariableInstance is the address of an input variable within a particular module instance.
AbsLocalValue is the absolute address of a local value within a module instance.
AbsModuleCall is the address of a "module" block relative to the root of the configuration.
No description provided by the author
AbsOutputValue is the absolute address of an output value within a module instance.
AbsProviderConfig is the absolute address of a provider configuration within a particular module instance.
AbsResource is an absolute address for a resource under a given module path.
AbsResourceInstance is an absolute address for a resource instance under a given module path.
AbsResourceInstanceObject represents one of the specific remote objects associated with a resource instance.
Check is the address of a check block within a module.
CheckRule is the address of a check rule within a checkable object.
CheckRuleDiagnosticExtra is an object that can be attached to diagnostics that originate from check rules.
ConfigCheck is an address for a check block within a configuration.
No description provided by the author
ConfigOutputValue represents a particular "output" block in the configuration, which might have many AbsOutputValue addresses associated with it at runtime if it belongs to a module that was called using "count" or "for_each".
ConfigResource is an address for a resource within a configuration.
CountAttr is the address of an attribute of the "count" object in the interpolation scope, like "count.index".
DirectedGraph represents a directed graph whose nodes are addresses of type T.
ForEachAttr is the address of an attribute referencing the current "for_each" object in the interpolation scope, addressed using the "each" keyword, ex.
InPartialExpandedModule is a generic type used for all address types that represent objects that exist inside module instances but do not have any expansion capability of their own beyond just the containing module expansion.
InputVariable is the address of an input variable.
LocalProviderConfig is the address of a provider configuration from the perspective of references in a particular module.
LocalValue is the address of a local value.
Map represents a mapping whose keys are address types that implement UniqueKeyer.
No description provided by the author
ModuleCall is the address of a call from the current module to a child module.
ModuleCallInstance is the address of one instance of a module created from a module call, which might create multiple instances using "count" or "for_each" arguments.
ModuleCallInstanceOutput is the address of a particular named output produced by an instance of a module call.
ModuleCallOutput is the address of a named output and its associated ModuleCall, which may expand into multiple module instances.
ModuleInstanceStep is a single traversal step through the dynamic module tree.
ModuleSourceRemote is a ModuleSource representing a remote location from which we can retrieve a module package.
MoveEndpoint is to AbsMoveable and ConfigMoveable what Target is to Targetable: a wrapping struct that captures the result of decoding an HCL traversal representing a relative path from the current module to a moveable object.
MoveEndpointInModule annotates a MoveEndpoint with the address of the module where it was declared, which is the form we use for resolving whether move statements chain from or are nested within other move statements.
OutputValue is the address of an output value, in the context of the module that is defining it.
PartialExpandedModule represents a set of module instances which all share a common known parent module instance but the remaining call instance keys are not yet known.
PartialExpandedResource represents a set of resource instances which all share a common known parent module instance but the remaining call instance keys are not yet known and the resource's own instance keys are not yet known.
PathAttr is the address of an attribute of the "path" object in the interpolation scope, like "path.module".
Reference describes a reference to an address with source location information.
Like MoveEndpoint, RemoveTarget is a wrapping struct that captures the result of decoding an HCL traversal representing a relative path from the current module to a removeable object.
Resource is an address for a resource block within configuration, which contains potentially-multiple resource instances if that configuration block uses "count" or "for_each".
ResourceInstance is an address for a specific instance of a resource.
ResourceInstancePhase is a special kind of reference used only internally during graph building to represent resource instances that are in a non-primary state.
ResourcePhase is a special kind of reference used only internally during graph building to represent resources that are in a non-primary state.
RootProviderConfig is essentially a special variant of AbsProviderConfig for situations where only root module provider configurations are allowed.
Run is the address of a run block within a testing file.
Target describes a targeted address with source location information.
TerraformAttr is the address of an attribute of the "terraform" object in the interpolation scope, like "terraform.workspace".
# Interfaces
AbsMoveable is an interface implemented by address types that can be either the source or destination of a "moved" statement in configuration, along with any other similar cross-module state refactoring statements we might allow.
AbsMoveableResource is an AbsMoveable that is either a resource or a resource instance.
Checkable is an interface implemented by all address types that can contain condition blocks.
ConfigCheckable is an interfaces implemented by address types that represent configuration constructs that can have Checkable addresses associated with them.
ConfigMoveable is similar to AbsMoveable but represents a static object in the configuration, rather than an instance of that object created by module expansion.
DiagnosticExtraCheckRule provides an interface for diagnostic ExtraInfo to retrieve an embedded CheckRule from within a tfdiags.Diagnostic.
InstanceKey represents the key of an instance within an object that contains multiple instances due to using "count" or "for_each" arguments in configuration.
ModuleSource is the general type for all three of the possible module source address types.
ProviderConfig is an interface type whose dynamic type can be either LocalProviderConfig or AbsProviderConfig, in order to represent situations where a value might either be module-local or absolute but the decision cannot be made until runtime.
Referenceable is an interface implemented by all address types that can appear as references in configuration language expressions.
Targetable is an interface implemented by all address types that can be used as "targets" for selecting sub-graphs of a graph.
UniqueKey is an interface implemented by values that serve as unique map keys for particular addresses.
UniqueKeyer is an interface implemented by types that can be represented by a unique key.
# Type aliases
CheckableKind describes the different kinds of checkable objects.
CheckRuleType describes a category of check.
DeposedKey is a 8-character hex string used to uniquely identify deposed instance objects in the state.
InstanceKeyType represents the different types of instance key that are supported.
IntKey is the InstanceKey representation representing integer indices, as used when the "count" argument is specified or if for_each is used with a sequence type.
Module is an address for a module call within configuration.
ModuleInstance is an address for a particular module instance within the dynamic module tree.
A ModulePackage represents a physical location where Terraform can retrieve a module package, which is an archive, repository, or other similar container which delivers the source code for one or more Terraform modules.
A ModuleRegistryPackage is an extra indirection over a ModulePackage where we use a module registry to translate a more symbolic address (and associated version constraint given out of band) into a physical source location.
ModuleSourceLocal is a ModuleSource representing a local path reference from the caller's directory to the callee's directory within the same module package.
ModuleSourceRegistry is a ModuleSource representing a module listed in a Terraform module registry.
MoveEndpointKind represents the different kinds of object that a movable address can refer to.
Provider encapsulates a single provider type.
RemoveTargetKind represents the different kinds of object that a remove target address can refer to.
ResourceInstancePhaseType is an enumeration used with ResourceInstancePhase.
ResourceMode defines which lifecycle applies to a given resource.
Set represents a set of addresses of types that implement UniqueKeyer.
StringKey is the InstanceKey representation representing string indices, as used when the "for_each" argument is specified with a map or object type.
No description provided by the author