diff --git a/internal/command/meta_backend.go b/internal/command/meta_backend.go index d72a56c1df..552ee6300b 100644 --- a/internal/command/meta_backend.go +++ b/internal/command/meta_backend.go @@ -663,7 +663,11 @@ func (m *Meta) backendFromConfig(opts *BackendOpts) (backend.Backend, tfdiags.Di } if !m.migrateState { - diags = diags.Append(migrateOrReconfigDiag) + if c.Type == "cloud" { + diags = diags.Append(migrateOrReconfigDiagCloud) + } else { + diags = diags.Append(migrateOrReconfigDiag) + } return nil, diags } @@ -1384,3 +1388,10 @@ var migrateOrReconfigDiag = tfdiags.Sourceless( "A change in the backend configuration has been detected, which may require migrating existing state.\n\n"+ "If you wish to attempt automatic migration of the state, use \"terraform init -migrate-state\".\n"+ `If you wish to store the current configuration with no changes to the state, use "terraform init -reconfigure".`) + +var migrateOrReconfigDiagCloud = tfdiags.Sourceless( + tfdiags.Error, + "Terraform Cloud configuration changed", + "A change in the Terraform Cloud configuration has been detected, which may require migrating existing state.\n\n"+ + "If you wish to attempt automatic migration of the state, use \"terraform init -migrate-state\".\n"+ + `If you wish to store the current configuration with no changes to the state, use "terraform init -reconfigure".`)