INNER CODE UNIT · Go
RequiresReplaceIfValuesNotNull
hashicorp/terraform-provider-null · internal/planmodifiers/attribute.go:12
func RequiresReplaceIfValuesNotNull() planmodifier.Map {
return requiresReplaceIfValuesNotNullModifier{}
}
type requiresReplaceIfValuesNotNullModifier struct{}
func (r requiresReplaceIfValuesNotNullModifier) PlanModifyMap(ctx context.Context, req planmodifier.MapRequest, resp *planmodifier.MapResponse) {
if req.State.Raw.IsNull() {
// if we're creating the resource, no need to delete and
// recreate it
return
}
if req.Plan.Raw.IsNull() {
// if we're deleting the resource, no need to delete and
// recreate it
return
}