Documentation
¶
Index ¶
- Constants
- func Contains(val cty.Value, mark valueMark) bool
- func ContainsAnyMark(val cty.Value, marks ...valueMark) bool
- func Deprecated(v cty.Value, cause DeprecationCause) cty.Value
- func DeprecatedDiagnosticOverride(cause DeprecationCause) func() tfdiags.DiagnosticExtraWrapper
- func DeprecatedOutput(v cty.Value, addr addrs.AbsOutputValue, msg string) cty.Value
- func DeprecationMark(cause DeprecationCause) any
- func EnsureNoEphemeralMarks(pvms []cty.PathValueMarks) error
- func ExtractDeprecatedDiagnosticsWithExpr(val cty.Value, expr hcl.Expression) (cty.Value, tfdiags.Diagnostics)
- func ExtractDeprecationDiagnosticsWithBody(val cty.Value, body hcl.Body) (cty.Value, tfdiags.Diagnostics)
- func Has(val cty.Value, mark valueMark) bool
- func HasDeprecated(v cty.Value) bool
- func RemoveDeepDeprecated(val cty.Value) cty.Value
- type DeprecationCause
- func DeprecationCauseOutput(out addrs.AbsOutputValue, message string) DeprecationCause
- func DeprecationCauseResource(res addrs.AbsResourceInstance, path cty.Path, message string) DeprecationCause
- func DeprecationCauseVariable(vaddr addrs.AbsInputVariableInstance, message string) DeprecationCause
- func DiagnosticDeprecationCause(diag tfdiags.Diagnostic) (DeprecationCause, bool)
Constants ¶
const Ephemeral = valueMark("Ephemeral")
Ephemeral indicates that this value is marked as ephemeral in the context of OpenTofu.
const Sensitive = valueMark("Sensitive")
Sensitive indicates that this value is marked as sensitive in the context of OpenTofu.
const TypeType = valueMark("TypeType")
TypeType is used to indicate that the value contains a representation of another value's type. This is part of the implementation of the console-only `type` function.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains returns true if the cty.Value or any value within it contains the given mark.
func ContainsAnyMark ¶
ContainsAnyMark returns true if the cty.Value or any value within it contains any of the given mark.
func Deprecated ¶
func Deprecated(v cty.Value, cause DeprecationCause) cty.Value
Deprecated marks a given value as deprecated with specified DeprecationCause.
func DeprecatedDiagnosticOverride ¶
func DeprecatedDiagnosticOverride(cause DeprecationCause) func() tfdiags.DiagnosticExtraWrapper
DeprecatedDiagnosticOverride is mainly created for unit testing. This is done this way just to avoid exporting deprecatedDiagnosticExtra from this package, which can create confusion when somebody would like to use this package.
func DeprecatedOutput ¶
DeprecatedOutput marks a given value as deprecated constructing a DeprecationCause from module output specific data.
func DeprecationMark ¶
func DeprecationMark(cause DeprecationCause) any
func EnsureNoEphemeralMarks ¶
func EnsureNoEphemeralMarks(pvms []cty.PathValueMarks) error
EnsureNoEphemeralMarks checks all the given paths for the Ephemeral mark. If there is at least one path marked as such, this method will return an error containing the marked paths.
func ExtractDeprecatedDiagnosticsWithExpr ¶
func ExtractDeprecatedDiagnosticsWithExpr(val cty.Value, expr hcl.Expression) (cty.Value, tfdiags.Diagnostics)
ExtractDeprecatedDiagnosticsWithExpr composes deprecation diagnostics based on deprecation marks inside the cty.Value. It uses hcl.Expression to properly reference deprecated attributes in final diagnostics. The returned cty.Value has no deprecation marks inside, since all the relevant diagnostics has been collected.
func ExtractDeprecationDiagnosticsWithBody ¶
func ExtractDeprecationDiagnosticsWithBody(val cty.Value, body hcl.Body) (cty.Value, tfdiags.Diagnostics)
ExtractDeprecationDiagnosticsWithBody composes deprecation diagnostics based on deprecation marks inside the cty.Value. It uses hcl.Body to properly reference deprecated attributes in final diagnostics. The returned cty.Value has no deprecation marks inside, since all the relevant diagnostics has been collected.
func HasDeprecated ¶
HasDeprecated returns true if the cty.Value contains a deprecated mark.
Types ¶
type DeprecationCause ¶
type DeprecationCause struct {
// contains filtered or unexported fields
}
func DeprecationCauseOutput ¶
func DeprecationCauseOutput(out addrs.AbsOutputValue, message string) DeprecationCause
func DeprecationCauseResource ¶
func DeprecationCauseResource(res addrs.AbsResourceInstance, path cty.Path, message string) DeprecationCause
func DeprecationCauseVariable ¶
func DeprecationCauseVariable(vaddr addrs.AbsInputVariableInstance, message string) DeprecationCause
func DiagnosticDeprecationCause ¶
func DiagnosticDeprecationCause(diag tfdiags.Diagnostic) (DeprecationCause, bool)
DiagnosticDeprecationCause checks whether the given diagnostic is a deprecation warning, and if so returns the deprecation cause and true. If not, returns the zero value of DeprecationCause and false.
func (DeprecationCause) ExtraInfoKey ¶
func (dc DeprecationCause) ExtraInfoKey() string
ExtraInfoKey returns the key used for consolidation of deprecation diagnostics. This will be enhanced by the view with module source address
func (DeprecationCause) ModuleInstance ¶
func (dc DeprecationCause) ModuleInstance() addrs.ModuleInstance