modifiers

package
v5.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package modifiers contains plan modifier related functions to be used with resource and data sources written using Terraform Provider Framework

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualUpToPrefixFunc

func EqualUpToPrefixFunc(prefix string) func(string, string) bool

EqualUpToPrefixFunc returns function that compares if two strings are equal stripping prefix

func PreventStringUpdate

func PreventStringUpdate() planmodifier.String

PreventStringUpdate returns a plan modifier that ensures given field cannot be updated after creation.

func SetUseStateIf

func SetUseStateIf(eqFunc func(string, string) bool) planmodifier.Set

SetUseStateIf returns a plan modifier that copies a known prior state value into the planned value if given function returns true. Use this when you want to suppress value changes. 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.

func StringUseStateIf

func StringUseStateIf(pred func(string, string) bool) planmodifier.String

StringUseStateIf returns a plan modifier that copies a known prior state value into the planned value if given function returns true. Use this when you want to suppress value changes. 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL