mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Fixes Issue #29959, Apply w/o init error message
When going from a local backend to Terraform Cloud, if you skip the `terraform init` and run `terraform apply` this will give the user more clear instructions.
This commit is contained in:
parent
d72a413ef8
commit
e08a02e7bf
@ -737,7 +737,7 @@ func (m *Meta) determineInitReason(previousBackendType string, currentBackendTyp
|
|||||||
diags = diags.Append(tfdiags.Sourceless(
|
diags = diags.Append(tfdiags.Sourceless(
|
||||||
tfdiags.Error,
|
tfdiags.Error,
|
||||||
"Terraform Cloud initialization required: please run \"terraform init\"",
|
"Terraform Cloud initialization required: please run \"terraform init\"",
|
||||||
fmt.Sprintf(strings.TrimSpace(errBackendInitCloudMigration), initReason),
|
fmt.Sprintf(strings.TrimSpace(errBackendInitCloud), initReason),
|
||||||
))
|
))
|
||||||
default:
|
default:
|
||||||
diags = diags.Append(tfdiags.Sourceless(
|
diags = diags.Append(tfdiags.Sourceless(
|
||||||
@ -1510,17 +1510,6 @@ hasn't changed and try again. At this point, no changes to your existing
|
|||||||
configuration or state have been made.
|
configuration or state have been made.
|
||||||
`
|
`
|
||||||
|
|
||||||
const errBackendInitCloudMigration = `
|
|
||||||
Reason: %s.
|
|
||||||
|
|
||||||
Migrating to Terraform Cloud requires reinitialization, to discover which Terraform Cloud workspaces belong to this configuration and to optionally migrate existing state to the corresponding Terraform Cloud workspaces.
|
|
||||||
|
|
||||||
To re-initialize, run:
|
|
||||||
terraform init
|
|
||||||
|
|
||||||
Terraform has not yet made changes to your existing configuration or state.
|
|
||||||
`
|
|
||||||
|
|
||||||
const errBackendInitCloud = `
|
const errBackendInitCloud = `
|
||||||
Reason: %s.
|
Reason: %s.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user