backend/remote: encourage use of -refresh-only

This commit is contained in:
CJ Horton 2021-05-26 23:08:39 -07:00
parent abf7f3416b
commit 314d322b59
1 changed files with 4 additions and 0 deletions

View File

@ -721,6 +721,10 @@ func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend
f = b.opPlan f = b.opPlan
case backend.OperationTypeApply: case backend.OperationTypeApply:
f = b.opApply f = b.opApply
case backend.OperationTypeRefresh:
return nil, fmt.Errorf(
"\n\nThe \"refresh\" operation is not supported when using the \"remote\" backend. " +
"Use \"terraform apply -refresh-only\" instead.")
default: default:
return nil, fmt.Errorf( return nil, fmt.Errorf(
"\n\nThe \"remote\" backend does not support the %q operation.", op.Type) "\n\nThe \"remote\" backend does not support the %q operation.", op.Type)