Documentation
¶
Overview ¶
Package int64planmodifier provides plan modifiers for types.Int64 attributes.
Index ¶
- func RequiresReplace() planmodifier.Int64
- func RequiresReplaceIf(f RequiresReplaceIfFunc, description, markdownDescription string) planmodifier.Int64
- func RequiresReplaceIfConfigured() planmodifier.Int64
- func UseNonNullStateForUnknown() planmodifier.Int64
- func UseStateForUnknown() planmodifier.Int64
- type RequiresReplaceIfFunc
- type RequiresReplaceIfFuncResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequiresReplace ¶
func RequiresReplace() planmodifier.Int64
RequiresReplace returns a plan modifier that conditionally requires resource replacement if:
- The resource is planned for update.
- The plan and state values are not equal.
Use RequiresReplaceIfConfigured if the resource replacement should only occur if there is a configuration value (ignore unconfigured drift detection changes). Use RequiresReplaceIf if the resource replacement should check provider-defined conditional logic.
func RequiresReplaceIf ¶
func RequiresReplaceIf(f RequiresReplaceIfFunc, description, markdownDescription string) planmodifier.Int64
RequiresReplaceIf returns a plan modifier that conditionally requires resource replacement if:
- The resource is planned for update.
- The plan and state values are not equal.
- The given function returns true. Returning false will not unset any prior resource replacement.
Use RequiresReplace if the resource replacement should always occur on value changes. Use RequiresReplaceIfConfigured if the resource replacement should occur on value changes, but only if there is a configuration value (ignore unconfigured drift detection changes).
func RequiresReplaceIfConfigured ¶
func RequiresReplaceIfConfigured() planmodifier.Int64
RequiresReplaceIfConfigured returns a plan modifier that conditionally requires resource replacement if:
- The resource is planned for update.
- The plan and state values are not equal.
- The configuration value is not null.
Use RequiresReplace if the resource replacement should occur regardless of the presence of a configuration value. Use RequiresReplaceIf if the resource replacement should check provider-defined conditional logic.
func UseNonNullStateForUnknown ¶ added in v1.17.0
func UseNonNullStateForUnknown() planmodifier.Int64
UseNonNullStateForUnknown returns a plan modifier that copies a known, non-null, prior state value into the planned value. Use this when it is known that an unconfigured value will remain the same after the attribute is updated to a non-null value.
To prevent Terraform errors, the framework automatically sets unconfigured and Computed attributes to an unknown value "(known after apply)" on update. Using this plan modifier will instead display the non-null prior state value in the plan, unless a prior plan modifier adjusts the value.
This plan modifier can be a useful alternative to UseStateForUnknown when the attribute is a child of a nested attribute that can be null after the resource is created.
func UseStateForUnknown ¶
func UseStateForUnknown() planmodifier.Int64
UseStateForUnknown returns a plan modifier that copies a known prior state value into the planned value. Use this when it is known that an unconfigured value will remain the same after a resource update.
To prevent Terraform errors, the framework automatically sets unconfigured and Computed attributes to an unknown value "(known after apply)" on update. Using this plan modifier will instead display the prior state value in the plan, unless a prior plan modifier adjusts the value.
Null is also a known value in Terraform and will be copied to the planned value by this plan modifier. For use-cases like a child attribute of a nested attribute or if null is desired to be marked as unknown in the case of an update, use UseNonNullStateForUnknown.
Types ¶
type RequiresReplaceIfFunc ¶
type RequiresReplaceIfFunc func(context.Context, planmodifier.Int64Request, *RequiresReplaceIfFuncResponse)
RequiresReplaceIfFunc is a conditional function used in the RequiresReplaceIf plan modifier to determine whether the attribute requires replacement.
type RequiresReplaceIfFuncResponse ¶
type RequiresReplaceIfFuncResponse struct {
// Diagnostics report errors or warnings related to this logic. An empty
// or unset slice indicates success, with no warnings or errors generated.
Diagnostics diag.Diagnostics
// RequiresReplace should be enabled if the resource should be replaced.
RequiresReplace bool
}
RequiresReplaceIfFuncResponse is the response type for a RequiresReplaceIfFunc.