github.com/opentofu/opentofu@v1.7.1/internal/plans/mode.go (about) 1 // Copyright (c) The OpenTofu Authors 2 // SPDX-License-Identifier: MPL-2.0 3 // Copyright (c) 2023 HashiCorp, Inc. 4 // SPDX-License-Identifier: MPL-2.0 5 6 package plans 7 8 // Mode represents the various mutually-exclusive modes for creating a plan. 9 type Mode rune 10 11 //go:generate go run golang.org/x/tools/cmd/stringer -type Mode 12 13 const ( 14 // NormalMode is the default planning mode, which aims to synchronize the 15 // prior state with remote objects and plan a set of actions intended to 16 // make those remote objects better match the current configuration. 17 NormalMode Mode = 0 18 19 // DestroyMode is a special planning mode for situations where the goal 20 // is to destroy all remote objects that are bound to instances in the 21 // prior state, even if the configuration for those instances is still 22 // present. 23 // 24 // This mode corresponds with the "-destroy" option to "tofu plan", 25 // and with the plan created by the "tofu destroy" command. 26 DestroyMode Mode = 'D' 27 28 // RefreshOnlyMode is a special planning mode which only performs the 29 // synchronization of prior state with remote objects, and skips any 30 // effort to generate any change actions for resource instances even if 31 // the configuration has changed relative to the state. 32 // 33 // This mode corresponds with the "-refresh-only" option to 34 // "tofu plan". 35 RefreshOnlyMode Mode = 'R' 36 )