package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Functions
BoolValue converts a cty value Go bool, or returns an error if that's not possible.
ErrorAsDiagnostics wraps a non-nil error as a tfdiags.Diagnostics.
GetAttrDefault is like [GetPathDefault] but more convenient for the common case of looking up a single top-level attribute.
GetAttrEnvDefault is like [GetPathEnvDefault] but more convenient for the common case of looking up a single top-level attribute.
GetAttrEnvDefaultFallback is like [GetPathEnvDefault] except that if neither the attribute nor the environment variable are set then instead of returning null it will return the given fallback value.
GetPathDefault traverses the steps of the given path through the given value, and then returns either that value or the value given in def, if the found value was null.
GetPathEnvDefault is like [GetPathDefault] except that the default value is taken from an environment variable of the name given in defEnv, returned as a string value.
GetPathEnvDefaultFallback is like [GetPathEnvDefault] except that if neither the attribute nor the environment variable are set then instead of returning null it will return the given fallback value.
IntValue converts a cty value into a Go int64, or returns an error if that's not possible.
MustBoolValue converts a cty value Go bool, or panics if that's not possible.
No description provided by the author
SDKLikeEnvDefault emulates an SDK-style "EnvDefaultFunc" by taking the result of [SDKLikeData.String] and a series of environment variable names.
SDKLikePath interprets a subset of the legacy SDK attribute path syntax -- identifiers separated by dots -- into a cty.Path.
SDKLikeRequiredWithEnvDefault is a convenience wrapper around [SDKLikeEnvDefault] which returns an error if the result is still the empty string even after trying all of the fallback environment variables.
# Structs
Base is a partial implementation of [backend.Backend] that can be embedded into another implementer to handle most of the configuration schema wrangling.
SDKLikeData offers an approximation of the legack SDK "ResourceData" API as a stopgap measure to help migrate all of the remote state backend implementations away from the legacy SDK.
No description provided by the author
# Type aliases
SDKLikeDefaults captures legacy-SDK-like default values to help fill the gap in abstraction level between the legacy SDK and Terraform's own configuration schema model.