Files
opentf/internal/engine/planning/resourceinstancereplaceorder_string.go
Martin Atkins 0b07c5094e planning: Decide the effective replace order for all objects
The first pass in the planning engine decides what we're now calling the
"initial replace order" for each object, which can either be
replaceAnyOrder or replaceCreateThenDestroy based purely on whether that
object was configured with "create_before_destroy = true" or not.

The second pass then analyses the materialized graph of resource instance
objects to translate any replaceAnyOrder objects into either
replaceDestroyThenCreate or replaceCreateThenDestroy depending on whether
they are in any dependency chain with something else that requires
replaceCreateThenDestroy.

For now we don't use the results of this for anything, but in a future
commit we'll use it to select the appropriate ordering for the apply-time
operations in the execution graph.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2026-02-23 10:25:42 -08:00

27 lines
927 B
Go

// Code generated by "stringer -type=resourceInstanceReplaceOrder -trimprefix=replace"; DO NOT EDIT.
package planning
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[replaceAnyOrder-0]
_ = x[replaceCreateThenDestroy-1]
_ = x[replaceDestroyThenCreate-2]
}
const _resourceInstanceReplaceOrder_name = "AnyOrderCreateThenDestroyDestroyThenCreate"
var _resourceInstanceReplaceOrder_index = [...]uint8{0, 8, 25, 42}
func (i resourceInstanceReplaceOrder) String() string {
idx := int(i) - 0
if i < 0 || idx >= len(_resourceInstanceReplaceOrder_index)-1 {
return "resourceInstanceReplaceOrder(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _resourceInstanceReplaceOrder_name[_resourceInstanceReplaceOrder_index[idx]:_resourceInstanceReplaceOrder_index[idx+1]]
}