Skip to content

Commit 029591d

Browse files
authored
Merge branch 'main' into docs/march-sprint-lang-rewrites
2 parents 6d5d38c + 2d6eda2 commit 029591d

File tree

20 files changed

+40
-36
lines changed

20 files changed

+40
-36
lines changed

internal/backend/backendrun/operation.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ func (o *Operation) Config() (*configs.Config, tfdiags.Diagnostics) {
177177
// operation.
178178
//
179179
// If the given diagnostics contains errors then the operation's result
180-
// will be set to backend.OperationFailure. It will be set to
181-
// backend.OperationSuccess otherwise. It will then use o.View.Diagnostics
180+
// will be set to backendrun.OperationFailure. It will be set to
181+
// backendrun.OperationSuccess otherwise. It will then use o.View.Diagnostics
182182
// to show the given diagnostics before returning.
183183
//
184184
// Callers should feel free to do each of these operations separately in

internal/backend/init/init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (b deprecatedBackendShim) PrepareConfig(obj cty.Value) (cty.Value, tfdiags.
128128
// warning during validation.
129129
func deprecateBackend(b backend.Backend, message string) backend.Backend {
130130
// Since a Backend wrapped by deprecatedBackendShim can no longer be
131-
// asserted as an Enhanced or Local backend, disallow those types here
131+
// asserted as an Operations Backend or Local backend, disallow those types here
132132
// entirely. If something other than a basic backend.Backend needs to be
133133
// deprecated, we can add that functionality to schema.Backend or the
134134
// backend itself.

internal/backend/local/backend.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const (
3232
DefaultBackupExtension = ".backup"
3333
)
3434

35-
// Local is an implementation of EnhancedBackend that performs all operations
35+
// Local is an implementation of backendrun.OperationsBackend that performs all operations
3636
// locally. This is the "default" backend and implements normal Terraform
3737
// behavior as it is well known.
3838
type Local struct {
@@ -79,9 +79,9 @@ type Local struct {
7979
OpInput bool
8080
OpValidation bool
8181

82-
// Backend, if non-nil, will use this backend for non-enhanced behavior.
82+
// Backend, if non-nil, will use this backend for non-operations behavior.
8383
// This allows local behavior with remote state storage. It is a way to
84-
// "upgrade" a non-enhanced backend to an enhanced backend with typical
84+
// "upgrade" a non-operations backend to an operations backend with typical
8585
// behavior.
8686
//
8787
// If this is nil, local performs normal state loading and storage.
@@ -100,7 +100,7 @@ func New() *Local {
100100
}
101101

102102
// NewWithBackend returns a new local backend initialized with a
103-
// dedicated backend for non-enhanced behavior.
103+
// dedicated backend for non-operations/state-storage behavior.
104104
func NewWithBackend(backend backend.Backend) *Local {
105105
return &Local{
106106
Backend: backend,

internal/backend/remote/backend.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
genericHostname = "localterraform.com"
4444
)
4545

46-
// Remote is an implementation of EnhancedBackend that performs all
46+
// Remote is an implementation of backendrun.OperationsBackend that performs all
4747
// operations in a remote backend.
4848
type Remote struct {
4949
// CLI and Colorize control the CLI output. If CLI is nil then no CLI
@@ -78,7 +78,7 @@ type Remote struct {
7878
// services is used for service discovery
7979
services *disco.Disco
8080

81-
// local, if non-nil, will be used for all enhanced behavior. This
81+
// local, if non-nil, will be used for all OperationsBackend behavior. This
8282
// allows local behavior with the remote backend functioning as remote
8383
// state storage backend.
8484
local backendrun.OperationsBackend

internal/backend/remote/backend_context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func stubAllVariables(vv map[string]backendrun.UnparsedVariableValue, decls map[
215215
return ret
216216
}
217217

218-
// remoteStoredVariableValue is a backend.UnparsedVariableValue implementation
218+
// remoteStoredVariableValue is a backendrun.UnparsedVariableValue implementation
219219
// that translates from the go-tfe representation of stored variables into
220220
// the Terraform Core backend representation of variables.
221221
type remoteStoredVariableValue struct {

internal/backend/remote/testing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func (v *unparsedVariableValue) ParseVariableValue(mode configs.VariableParsingM
315315
}, tfdiags.Diagnostics{}
316316
}
317317

318-
// testVariable returns a backend.UnparsedVariableValue used for testing.
318+
// testVariable returns a backendrun.UnparsedVariableValue used for testing.
319319
func testVariables(s terraform.ValueSourceType, vs ...string) map[string]backendrun.UnparsedVariableValue {
320320
vars := make(map[string]backendrun.UnparsedVariableValue, len(vs))
321321
for _, v := range vs {

internal/builtin/providers/terraform/data_source_state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func getBackend(cfg cty.Value) (backend.Backend, cty.Value, tfdiags.Diagnostics)
239239
return nil, cty.NilVal, diags
240240
}
241241

242-
// If this is the enhanced remote backend, we want to disable the version
242+
// If this is the remote OperationsBackend, we want to disable the version
243243
// check, because this is a read-only operation
244244
if rb, ok := b.(*remote.Remote); ok {
245245
rb.IgnoreVersionConflict()

internal/cloud/backend.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const (
4949

5050
var ErrCloudDoesNotSupportKVTags = errors.New("your version of Terraform Enterprise does not support key-value tags. Please upgrade Terraform Enterprise to a version that supports this feature or use set type tags instead.")
5151

52-
// Cloud is an implementation of EnhancedBackend in service of the HCP Terraform or Terraform Enterprise
52+
// Cloud is an implementation of backendrun.OperationsBackend in service of the HCP Terraform or Terraform Enterprise
5353
// integration for Terraform CLI. This backend is not intended to be surfaced at the user level and
5454
// is instead an implementation detail of cloud.Cloud.
5555
type Cloud struct {
@@ -131,7 +131,7 @@ func New(services *disco.Disco) *Cloud {
131131
}
132132
}
133133

134-
// ConfigSchema implements backend.Enhanced.
134+
// ConfigSchema implements backend.Backend (which is embedded in backendrun.OperationsBackend).
135135
func (b *Cloud) ConfigSchema() *configschema.Block {
136136
return &configschema.Block{
137137
Attributes: map[string]*configschema.Attribute{
@@ -179,9 +179,9 @@ func (b *Cloud) ConfigSchema() *configschema.Block {
179179
}
180180
}
181181

182-
// PrepareConfig implements backend.Backend. Per the interface contract, it
183-
// should catch invalid contents in the config value and populate knowable
184-
// default values, but must NOT consult environment variables or other knowledge
182+
// PrepareConfig implements backend.Backend (which is embedded in backendrun.OperationsBackend).
183+
// Per the interface contract, it should catch invalid contents in the config value and populate
184+
// knowable default values, but must NOT consult environment variables or other knowledge
185185
// outside the config value itself.
186186
func (b *Cloud) PrepareConfig(obj cty.Value) (cty.Value, tfdiags.Diagnostics) {
187187
var diags tfdiags.Diagnostics
@@ -227,7 +227,7 @@ func (b *Cloud) ServiceDiscoveryAliases() ([]backendrun.HostAlias, error) {
227227
}, nil
228228
}
229229

230-
// Configure implements backend.Enhanced.
230+
// Configure implements backend.Backend (which is embedded in backendrun.OperationsBackend).
231231
func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
232232
var diags tfdiags.Diagnostics
233233
if obj.IsNull() {
@@ -614,8 +614,8 @@ func (b *Cloud) retryLogHook(attemptNum int, resp *http.Response) {
614614
}
615615
}
616616

617-
// Workspaces implements backend.Enhanced, returning a filtered list of workspace names according to
618-
// the workspace mapping strategy configured.
617+
// Workspaces implements backend.Backend (which is embedded in backendrun.OperationsBackend),
618+
// returning a filtered list of workspace names according to the workspace mapping strategy configured.
619619
func (b *Cloud) Workspaces() ([]string, error) {
620620
// Create a slice to contain all the names.
621621
var names []string
@@ -689,7 +689,7 @@ func (b *Cloud) Workspaces() ([]string, error) {
689689
return names, nil
690690
}
691691

692-
// DeleteWorkspace implements backend.Backend.
692+
// DeleteWorkspace implements backend.Backend (which is embedded in backendrun.OperationsBackend).
693693
func (b *Cloud) DeleteWorkspace(name string, force bool) error {
694694
if name == backend.DefaultStateName {
695695
return backend.ErrDefaultWorkspaceNotSupported
@@ -713,7 +713,7 @@ func (b *Cloud) DeleteWorkspace(name string, force bool) error {
713713
return State.Delete(force)
714714
}
715715

716-
// StateMgr implements backend.Enhanced.
716+
// StateMgr implements backend.Backend (which is embedded in backendrun.OperationsBackend).
717717
func (b *Cloud) StateMgr(name string) (statemgr.Full, error) {
718718
var remoteTFVersion string
719719

internal/cloud/backend_context.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/hashicorp/terraform/internal/tfdiags"
2222
)
2323

24-
// LocalRun implements backend.Local
24+
// LocalRun implements backendrun.Local
2525
func (b *Cloud) LocalRun(op *backendrun.Operation) (*backendrun.LocalRun, statemgr.Full, tfdiags.Diagnostics) {
2626
var diags tfdiags.Diagnostics
2727
ret := &backendrun.LocalRun{
@@ -211,7 +211,7 @@ func stubAllVariables(vv map[string]backendrun.UnparsedVariableValue, decls map[
211211
return ret
212212
}
213213

214-
// remoteStoredVariableValue is a backend.UnparsedVariableValue implementation
214+
// remoteStoredVariableValue is a backendrun.UnparsedVariableValue implementation
215215
// that translates from the go-tfe representation of stored variables into
216216
// the Terraform Core backend representation of variables.
217217
type remoteStoredVariableValue struct {

internal/cloud/testing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ func (v *unparsedVariableValue) ParseVariableValue(mode configs.VariableParsingM
617617
}, tfdiags.Diagnostics{}
618618
}
619619

620-
// testVariable returns a backend.UnparsedVariableValue used for testing.
620+
// testVariable returns a backendrun.UnparsedVariableValue used for testing.
621621
func testVariables(s terraform.ValueSourceType, vs ...string) map[string]backendrun.UnparsedVariableValue {
622622
vars := make(map[string]backendrun.UnparsedVariableValue, len(vs))
623623
for _, v := range vs {

internal/command/command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const DefaultBackupExtension = ".backup"
4545
const DefaultParallelism = 10
4646

4747
// ErrUnsupportedLocalOp is the common error message shown for operations
48-
// that require a backend.Local.
48+
// that require a backendrun.Local.
4949
const ErrUnsupportedLocalOp = `The configured backend doesn't support this operation.
5050
5151
The "backend" in Terraform defines how Terraform operates. The default

internal/command/import.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (c *ImportCommand) Run(args []string) int {
173173
return 1
174174
}
175175

176-
// We require a backend.Local to build a context.
176+
// We require a backendrun.Local to build a context.
177177
// This isn't necessarily a "local.Local" backend, which provides local
178178
// operations, however that is the only current implementation. A
179179
// "local.Local" backend also doesn't necessarily provide local state, as

internal/command/meta_backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func (m *Meta) backendCLIOpts() (*backendrun.CLIOpts, error) {
398398
}, err
399399
}
400400

401-
// Operation initializes a new backend.Operation struct.
401+
// Operation initializes a new backendrun.Operation struct.
402402
//
403403
// This prepares the operation. After calling this, the caller is expected
404404
// to modify fields of the operation such as Sequence to specify what will

internal/command/meta_vars.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const VarEnvPrefix = "TF_VAR_"
2626

2727
// collectVariableValuesForTests inspects the various places that test
2828
// values can come from and constructs a map ready to be passed to the
29-
// backend as part of a backend.Operation.
29+
// backend as part of a backendrun.Operation.
3030
//
3131
// This method returns diagnostics relating to the collection of the values,
3232
// but the values themselves may produce additional diagnostics when finally
@@ -87,7 +87,7 @@ func (m *Meta) collectVariableValuesForTests(testsFilePath string) (map[string]b
8787

8888
// collectVariableValues inspects the various places that root module input variable
8989
// values can come from and constructs a map ready to be passed to the
90-
// backend as part of a backend.Operation.
90+
// backend as part of a backendrun.Operation.
9191
//
9292
// This method returns diagnostics relating to the collection of the values,
9393
// but the values themselves may produce additional diagnostics when finally

internal/command/state_mv.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import (
1919
"github.com/hashicorp/terraform/internal/tfdiags"
2020
)
2121

22-
// StateMvCommand is a Command implementation that shows a single resource.
22+
// StateMvCommand is a Command implementation that changes bindings
23+
// in Terraform state so that existing remote objects bind to new resource instances.
2324
type StateMvCommand struct {
2425
StateMeta
2526
}

internal/command/state_pull.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import (
1212
"github.com/hashicorp/terraform/internal/states/statemgr"
1313
)
1414

15-
// StatePullCommand is a Command implementation that shows a single resource.
15+
// StatePullCommand is a Command implementation that allows downloading
16+
// and outputting state information from remote state.
1617
type StatePullCommand struct {
1718
Meta
1819
StateMeta

internal/command/state_push.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import (
1919
"github.com/hashicorp/terraform/internal/tfdiags"
2020
)
2121

22-
// StatePushCommand is a Command implementation that shows a single resource.
22+
// StatePushCommand is a Command implementation that allows
23+
// pushing a local state to a remote location.
2324
type StatePushCommand struct {
2425
Meta
2526
StateMeta

internal/command/state_rm.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import (
1616
"github.com/hashicorp/terraform/internal/tfdiags"
1717
)
1818

19-
// StateRmCommand is a Command implementation that shows a single resource.
19+
// StateRmCommand is a Command implementation that removes
20+
// a single resource from the state.
2021
type StateRmCommand struct {
2122
StateMeta
2223
}

internal/states/statemgr/persistent.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Persistent interface {
3030

3131
// OutputReader is the interface for managers that fetches output values from state
3232
// or another source. This is a refinement of fetching the entire state and digging
33-
// the output values from it because enhanced backends can apply special permissions
33+
// the output values from it because operations backends can apply special permissions
3434
// to differentiate reading the state and reading the outputs within the state.
3535
type OutputReader interface {
3636
// GetRootOutputValues fetches the root module output values from state or another source

website/docs/language/functions/issensitive.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ See [`sensitive`](/terraform/language/functions/sensitive), [`nonsensitive`](/te
2222
true
2323
> issensitive("hello")
2424
false
25-
> sensitive(var.my-var-with-sensitive-set-to-true)
25+
> issensitive(var.my-var-with-sensitive-set-to-true)
2626
true
2727
```

0 commit comments

Comments
 (0)