diff --git a/backend/backend.go b/backend/backend.go index 09a16fbaa..a84d33d63 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -136,8 +136,9 @@ type Operation struct { // The duration to retry obtaining a State lock. StateLockTimeout time.Duration - // Environment is the named state that should be loaded from the Backend. - Environment string + // Workspace is the name of the workspace that this operation should run + // in, which controls which named state is used. + Workspace string } // RunningOperation is the result of starting an operation. diff --git a/backend/local/backend_local.go b/backend/local/backend_local.go index 833632321..7e5c872a1 100644 --- a/backend/local/backend_local.go +++ b/backend/local/backend_local.go @@ -23,7 +23,7 @@ func (b *Local) Context(op *backend.Operation) (*terraform.Context, state.State, func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State, error) { // Get the state. - s, err := b.State(op.Environment) + s, err := b.State(op.Workspace) if err != nil { return nil, nil, errwrap.Wrapf("Error loading state: {{err}}", err) } diff --git a/command/meta_backend.go b/command/meta_backend.go index e6fe1254b..690eddcbd 100644 --- a/command/meta_backend.go +++ b/command/meta_backend.go @@ -168,7 +168,7 @@ func (m *Meta) Operation() *backend.Operation { PlanOutBackend: m.backendState, Targets: m.targets, UIIn: m.UIInput(), - Environment: m.Workspace(), + Workspace: m.Workspace(), LockState: m.stateLock, StateLockTimeout: m.stateLockTimeout, }