Remove all Terraform Cloud mentions in STDOUTs in the codebase (#703)

This commit is contained in:
RLRabinowitz 2023-10-12 14:07:16 +03:00 committed by GitHub
parent 00165570e2
commit 8967cdcee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 130 additions and 130 deletions

View File

@ -315,7 +315,7 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
"Failed to create the cloud backend client",
fmt.Sprintf(
`Encountered an unexpected error while creating the `+
`Terraform cloud backend client: %s.`, err,
`cloud backend client: %s.`, err,
),
))
return diags
@ -1113,14 +1113,14 @@ func (b *Cloud) fetchWorkspace(ctx context.Context, organization string, workspa
case tfe.ErrResourceNotFound:
return nil, fmt.Errorf(
"workspace %s not found\n\n"+
"For security, Terraform Cloud returns '404 Not Found' responses for resources\n"+
"For security, cloud backends return '404 Not Found' responses for resources\n"+
"for resources that a user doesn't have access to, in addition to resources that\n"+
"do not exist. If the resource does exist, please check the permissions of the provided token.",
workspace,
)
default:
err := fmt.Errorf(
"Terraform Cloud returned an unexpected error:\n\n%w",
"Cloud backend returned an unexpected error:\n\n%w",
err,
)
return nil, err
@ -1140,7 +1140,7 @@ func (b *Cloud) validWorkspaceEnvVar(ctx context.Context, organization, workspac
if err != nil && err != tfe.ErrResourceNotFound {
return tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud returned an unexpected error",
"Cloud backend returned an unexpected error",
err.Error(),
)
}
@ -1164,7 +1164,7 @@ func (b *Cloud) validWorkspaceEnvVar(ctx context.Context, organization, workspac
if err != nil {
return tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud returned an unexpected error",
"Cloud backend returned an unexpected error",
err.Error(),
)
}
@ -1225,7 +1225,7 @@ func generalError(msg string, err error) error {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
fmt.Sprintf("%s: %v", msg, err),
"For security, Terraform Cloud returns '404 Not Found' responses for resources\n"+
"For security, cloud backends returns '404 Not Found' responses for resources\n"+
"for resources that a user doesn't have access to, in addition to resources that\n"+
"do not exist. If the resource does exist, please check the permissions of the provided token.",
))
@ -1234,7 +1234,7 @@ func generalError(msg string, err error) error {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
fmt.Sprintf("%s: %v", msg, err),
`Terraform Cloud returned an unexpected error. Sometimes `+
`Cloud backend returned an unexpected error. Sometimes `+
`this is caused by network connection problems, in which case you could retry `+
`the command. If the issue persists please open a support ticket to get help `+
`resolving the problem.`,
@ -1245,7 +1245,7 @@ func generalError(msg string, err error) error {
// The newline in this error is to make it look good in the CLI!
const initialRetryError = `
[reset][yellow]There was an error connecting to Terraform Cloud. Please do not exit
[reset][yellow]There was an error connecting to the cloud backend. Please do not exit
OpenTofu to prevent data loss! Trying to restore the connection...
[reset]
`
@ -1265,7 +1265,7 @@ const operationNotCanceled = `
const refreshToApplyRefresh = `[bold][yellow]Proceeding with 'tofu apply -refresh-only -auto-approve'.[reset]`
const unavailableTerraformVersion = `
[reset][yellow]The local OpenTofu version (%s) is not available in Terraform Cloud, or your
[reset][yellow]The local OpenTofu version (%s) is not available in the cloud backend, or your
organization does not have access to it. The new workspace will use %s. You can
change this later in the workspace settings.[reset]`
@ -1278,7 +1278,7 @@ Please reach out to OpenTofu Support to resolve this issue.`
var (
workspaceConfigurationHelp = fmt.Sprintf(
`The 'workspaces' block configures how OpenTofu CLI maps its workspaces for this single
configuration to workspaces within a Terraform Cloud organization. Two strategies are available:
configuration to workspaces within a cloud backend organization. Two strategies are available:
[bold]tags[reset] - %s
@ -1292,11 +1292,11 @@ configuration to workspaces within a Terraform Cloud organization. Two strategie
be set, and 'tofu login' used instead; your credentials will then be fetched from your CLI
configuration file or configured credential helper.`
schemaDescriptionTags = `A set of tags used to select remote Terraform Cloud workspaces to be used for this single
schemaDescriptionTags = `A set of tags used to select remote cloud backend workspaces to be used for this single
configuration. New workspaces will automatically be tagged with these tag values. Generally, this
is the primary and recommended strategy to use. This option conflicts with "name".`
schemaDescriptionName = `The name of a single Terraform Cloud workspace to be used with this configuration.
schemaDescriptionName = `The name of a single cloud backend workspace to be used with this configuration.
When configured, only the specified workspace can be used. This option conflicts with "tags".`
schemaDescriptionProject = `The name of a project that resulting workspace(s) will be created in.`

View File

@ -51,7 +51,7 @@ func (b *Cloud) opApply(stopCtx, cancelCtx context.Context, op *backend.Operatio
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Custom parallelism values are currently not supported",
`Terraform Cloud does not support setting a custom parallelism `+
`Cloud backend does not support setting a custom parallelism `+
`value at this time.`,
))
}
@ -60,7 +60,7 @@ func (b *Cloud) opApply(stopCtx, cancelCtx context.Context, op *backend.Operatio
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Applying a saved local plan is not supported",
`Terraform Cloud can apply a saved cloud plan, or create a new plan when `+
`Cloud backend can apply a saved cloud plan, or create a new plan when `+
`configuration is present. It cannot apply a saved local plan.`,
))
}
@ -289,10 +289,10 @@ func unusableSavedPlanError(status tfe.RunStatus, url string) error {
reason = "The given plan file is already being applied, and cannot be applied again."
case tfe.RunCanceled:
summary = "Saved plan is canceled"
reason = "The given plan file can no longer be applied because the run was canceled via the Terraform Cloud UI or API."
reason = "The given plan file can no longer be applied because the run was canceled via the cloud backend UI or API."
case tfe.RunDiscarded:
summary = "Saved plan is discarded"
reason = "The given plan file can no longer be applied; either another run was applied first, or a user discarded it via the Terraform Cloud UI or API."
reason = "The given plan file can no longer be applied; either another run was applied first, or a user discarded it via the cloud backend UI or API."
case tfe.RunErrored:
summary = "Saved plan is errored"
reason = "The given plan file refers to a plan that had errors and did not complete successfully. It cannot be applied."
@ -307,7 +307,7 @@ func unusableSavedPlanError(status tfe.RunStatus, url string) error {
reason = "The given plan file has soft policy failures, and cannot be applied until a user with appropriate permissions overrides the policy check."
default:
summary = "Saved plan cannot be applied"
reason = "Terraform Cloud cannot apply the given plan file. This may mean the plan and checks have not yet completed, or may indicate another problem."
reason = "Cloud backend cannot apply the given plan file. This may mean the plan and checks have not yet completed, or may indicate another problem."
}
diags = diags.Append(tfdiags.Sourceless(
@ -319,7 +319,7 @@ func unusableSavedPlanError(status tfe.RunStatus, url string) error {
}
const applyDefaultHeader = `
[reset][yellow]Running apply in Terraform Cloud. Output will stream here. Pressing Ctrl-C
[reset][yellow]Running apply in cloud backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.[reset]
@ -327,7 +327,7 @@ Preparing the remote apply...
`
const applySavedHeader = `
[reset][yellow]Running apply in Terraform Cloud. Output will stream here. Pressing Ctrl-C
[reset][yellow]Running apply in cloud backend. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the apply running remotely.[reset]
Preparing the remote apply...

View File

@ -103,7 +103,7 @@ func TestCloud_applyBasic(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -684,7 +684,7 @@ func TestCloud_applyWithRequiredVariables(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
}
@ -838,7 +838,7 @@ func TestCloud_applyAutoApprove(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -909,7 +909,7 @@ func TestCloud_applyApprovedExternally(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -983,7 +983,7 @@ func TestCloud_applyDiscardedExternally(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1052,7 +1052,7 @@ func TestCloud_applyWithAutoApprove(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1108,7 +1108,7 @@ func TestCloud_applyForceLocal(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if strings.Contains(output, "Running apply in Terraform Cloud") {
if strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
if output := done(t).Stdout(); !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1171,7 +1171,7 @@ func TestCloud_applyWorkspaceWithoutOperations(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if strings.Contains(output, "Running apply in Terraform Cloud") {
if strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
if output := done(t).Stdout(); !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1242,7 +1242,7 @@ func TestCloud_applyLockTimeout(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Lock timeout exceeded") {
@ -1291,7 +1291,7 @@ func TestCloud_applyDestroy(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "0 to add, 0 to change, 1 to destroy") {
@ -1468,7 +1468,7 @@ func TestCloud_applyPolicyPass(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1521,7 +1521,7 @@ func TestCloud_applyPolicyHardFail(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1571,7 +1571,7 @@ func TestCloud_applyPolicySoftFail(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1720,7 +1720,7 @@ func TestCloud_applyPolicySoftFailAutoApprove(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running apply in Terraform Cloud") {
if !strings.Contains(output, "Running apply in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1924,7 +1924,7 @@ func TestCloud_applyVersionCheck(t *testing.T) {
t.Fatalf("operation failed: %s", b.CLI.(*cli.MockUi).ErrorWriter.String())
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
hasRemote := strings.Contains(output, "Running apply in Terraform Cloud")
hasRemote := strings.Contains(output, "Running apply in cloud backend")
hasSummary := strings.Contains(output, "1 added, 0 changed, 0 destroyed")
hasResources := run.State.HasManagedResourceInstanceObjects()
if !tc.forceLocal && !isLocalExecutionMode(tc.executionMode) {

View File

@ -51,7 +51,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Custom parallelism values are currently not supported",
`Terraform Cloud does not support setting a custom parallelism `+
`Cloud backend does not support setting a custom parallelism `+
`value at this time.`,
))
}
@ -60,7 +60,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Displaying a saved plan is currently not supported",
`Terraform Cloud currently requires configuration to be present and `+
`Cloud backend currently requires configuration to be present and `+
`does not accept an existing saved plan as an argument at this time.`,
))
}
@ -236,7 +236,7 @@ in order to capture the filesystem context the remote workspace expects:
// field.
return nil, generalError(
"Invalid plan mode",
fmt.Errorf("Terraform Cloud doesn't support %s", op.PlanMode),
fmt.Errorf("Cloud backend doesn't support %s", op.PlanMode),
)
}
@ -417,7 +417,7 @@ func (b *Cloud) AssertImportCompatible(config *configs.Config) error {
}
desiredAgentVersion, _ := version.NewVersion("1.10")
if currentAgentVersion.LessThan(desiredAgentVersion) {
return fmt.Errorf("Import blocks are not supported in this version of the Terraform Cloud Agent. You are using agent version %s, but this feature requires version %s. Please remove any import blocks from your config or upgrade your agent.", currentAgentVersion, desiredAgentVersion)
return fmt.Errorf("Import blocks are not supported in this version of the cloud backend Agent. You are using agent version %s, but this feature requires version %s. Please remove any import blocks from your config or upgrade your agent.", currentAgentVersion, desiredAgentVersion)
}
}
return nil
@ -620,7 +620,7 @@ func shouldGenerateConfig(out string, run *tfe.Run) bool {
}
const planDefaultHeader = `
[reset][yellow]Running plan in Terraform Cloud. Output will stream here. Pressing Ctrl-C
[reset][yellow]Running plan in cloud backend. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the plan running remotely.[reset]
Preparing the remote plan...

View File

@ -90,7 +90,7 @@ func TestCloud_planBasic(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -204,7 +204,7 @@ func TestCloud_planLongLine(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -388,7 +388,7 @@ func TestCloud_planWithPath(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -626,7 +626,7 @@ func TestCloud_planWithRequiredVariables(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
}
@ -727,7 +727,7 @@ func TestCloud_planForceLocal(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if strings.Contains(output, "Running plan in Terraform Cloud") {
if strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
if output := done(t).Stdout(); !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -763,7 +763,7 @@ func TestCloud_planWithoutOperationsEntitlement(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if strings.Contains(output, "Running plan in Terraform Cloud") {
if strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
if output := done(t).Stdout(); !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -813,7 +813,7 @@ func TestCloud_planWorkspaceWithoutOperations(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if strings.Contains(output, "Running plan in Terraform Cloud") {
if strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("unexpected TFC header in output: %s", output)
}
if output := done(t).Stdout(); !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -881,7 +881,7 @@ func TestCloud_planLockTimeout(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Lock timeout exceeded") {
@ -979,7 +979,7 @@ func TestCloud_planWithWorkingDirectory(t *testing.T) {
if !strings.Contains(output, "The remote workspace is configured to work with configuration") {
t.Fatalf("expected working directory warning: %s", output)
}
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1035,7 +1035,7 @@ func TestCloud_planWithWorkingDirectoryFromCurrentPath(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
@ -1067,7 +1067,7 @@ func TestCloud_planCostEstimation(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Resources: 1 of 1 estimated") {
@ -1102,7 +1102,7 @@ func TestCloud_planPolicyPass(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Sentinel Result: true") {
@ -1142,7 +1142,7 @@ func TestCloud_planPolicyHardFail(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Sentinel Result: false") {
@ -1182,7 +1182,7 @@ func TestCloud_planPolicySoftFail(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "Sentinel Result: false") {
@ -1217,7 +1217,7 @@ func TestCloud_planWithRemoteError(t *testing.T) {
}
output := b.CLI.(*cli.MockUi).OutputWriter.String()
if !strings.Contains(output, "Running plan in Terraform Cloud") {
if !strings.Contains(output, "Running plan in cloud backend") {
t.Fatalf("expected TFC header in output: %s", output)
}
if !strings.Contains(output, "null_resource.foo: 1 error") {
@ -1282,7 +1282,7 @@ func TestCloud_planOtherError(t *testing.T) {
}
if !strings.Contains(err.Error(),
"Terraform Cloud returned an unexpected error:\n\nI'm a little teacup") {
"Cloud backend returned an unexpected error:\n\nI'm a little teacup") {
t.Fatalf("expected error message, got: %s", err.Error())
}
}

View File

@ -105,5 +105,5 @@ func (c *CloudCommand) Help() string {
// Synopsis returns a short summary of the cloud command.
func (c *CloudCommand) Synopsis() string {
return "Manage Terraform Cloud settings and metadata"
return "Manage cloud backend settings and metadata"
}

View File

@ -12,7 +12,7 @@ const failedToLoadSchemasMessage = `
Warning: Failed to update data for external integrations
OpenTofu was unable to generate a description of the updated
state for use with external integrations in Terraform Cloud.
state for use with external integrations in the cloud backend.
Any integrations configured for this workspace which depend on
information from the state may not work correctly when using the
result of this action.

View File

@ -399,17 +399,17 @@ func (c *InitCommand) getModules(ctx context.Context, path, testsDir string, ear
}
func (c *InitCommand) initCloud(ctx context.Context, root *configs.Module, extraConfig rawFlags) (be backend.Backend, output bool, diags tfdiags.Diagnostics) {
ctx, span := tracer.Start(ctx, "initialize Terraform Cloud")
ctx, span := tracer.Start(ctx, "initialize cloud backend")
_ = ctx // prevent staticcheck from complaining to avoid a maintenence hazard of having the wrong ctx in scope here
defer span.End()
c.Ui.Output(c.Colorize().Color("\n[reset][bold]Initializing Terraform Cloud..."))
c.Ui.Output(c.Colorize().Color("\n[reset][bold]Initializing cloud backend..."))
if len(extraConfig.AllItems()) != 0 {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Invalid command-line option",
"The -backend-config=... command line option is only for state backends, and is not applicable to Terraform Cloud-based configurations.\n\nTo change the set of workspaces associated with this configuration, edit the Cloud configuration block in the root module.",
"The -backend-config=... command line option is only for state backends, and is not applicable to cloud backend-based configurations.\n\nTo change the set of workspaces associated with this configuration, edit the Cloud configuration block in the root module.",
))
return nil, true, diags
}
@ -441,7 +441,7 @@ func (c *InitCommand) initBackend(ctx context.Context, root *configs.Module, ext
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unsupported backend type",
Detail: fmt.Sprintf("There is no explicit backend type named %q. To configure Terraform Cloud, declare a 'cloud' block instead.", backendType),
Detail: fmt.Sprintf("There is no explicit backend type named %q. To configure cloud backend, declare a 'cloud' block instead.", backendType),
Subject: &root.Backend.TypeRange,
})
return nil, true, diags
@ -1119,7 +1119,7 @@ Usage: tofu [global options] init [options]
Options:
-backend=false Disable backend or Terraform Cloud initialization
-backend=false Disable backend or cloud backend initialization
for this configuration and use what was previously
initialized instead.
@ -1174,12 +1174,12 @@ Options:
-lockfile=MODE Set a dependency lockfile mode.
Currently only "readonly" is valid.
-ignore-remote-version A rare option used for Terraform Cloud and the remote backend
-ignore-remote-version A rare option used for cloud backend and the remote backend
only. Set this to ignore checking that the local and remote
OpenTofu versions use compatible state representations, making
an operation proceed even when there is a potential mismatch.
See the documentation on configuring OpenTofu with
Terraform Cloud for more information.
cloud backend for more information.
-test-directory=path Set the OpenTofu test directory, defaults to "tests". When set, the
test command will search for test files in the current directory and
@ -1221,7 +1221,7 @@ const outputInitSuccess = `
`
const outputInitSuccessCloud = `
[reset][bold][green]Terraform Cloud has been successfully initialized![reset][green]
[reset][bold][green]Cloud backend has been successfully initialized![reset][green]
`
const outputInitSuccessCLI = `[reset][green]
@ -1235,7 +1235,7 @@ commands will detect it and remind you to do so if necessary.
`
const outputInitSuccessCLICloud = `[reset][green]
You may now begin working with Terraform Cloud. Try running "tofu plan" to
You may now begin working with cloud backend. Try running "tofu plan" to
see any changes that are required for your infrastructure.
If you ever set or change modules or OpenTofu Settings, run "tofu init"

View File

@ -994,7 +994,7 @@ func TestInit_backendCloudInvalidOptions(t *testing.T) {
Error: Invalid command-line option
The -backend-config=... command line option is only for state backends, and
is not applicable to Terraform Cloud-based configurations.
is not applicable to cloud backend-based configurations.
To change the set of workspaces associated with this configuration, edit the
Cloud configuration block in the root module.
@ -1033,9 +1033,9 @@ Cloud configuration block in the root module.
Error: Invalid command-line option
The -reconfigure option is for in-place reconfiguration of state backends
only, and is not needed when changing Terraform Cloud settings.
only, and is not needed when changing cloud backend settings.
When using Terraform Cloud, initialization automatically activates any new
When using cloud backend, initialization automatically activates any new
Cloud configuration settings.
`
@ -1071,8 +1071,8 @@ Cloud configuration settings.
wantStderr := `
Error: Invalid command-line option
The -reconfigure option is unsupported when migrating to Terraform Cloud,
because activating Terraform Cloud involves some additional steps.
The -reconfigure option is unsupported when migrating to cloud backend,
because activating cloud backend involves some additional steps.
`
if diff := cmp.Diff(wantStderr, gotStderr); diff != "" {
@ -1103,9 +1103,9 @@ because activating Terraform Cloud involves some additional steps.
Error: Invalid command-line option
The -migrate-state option is for migration between state backends only, and
is not applicable when using Terraform Cloud.
is not applicable when using cloud backend.
State storage is handled automatically by Terraform Cloud and so the state
State storage is handled automatically by cloud backend and so the state
storage location is not configurable.
`
@ -1142,9 +1142,9 @@ storage location is not configurable.
Error: Invalid command-line option
The -migrate-state option is for migration between state backends only, and
is not applicable when using Terraform Cloud.
is not applicable when using cloud backend.
Terraform Cloud migration has additional steps, configured by interactive
Cloud backend migration has additional steps, configured by interactive
prompts.
`
@ -1176,9 +1176,9 @@ prompts.
Error: Invalid command-line option
The -force-copy option is for migration between state backends only, and is
not applicable when using Terraform Cloud.
not applicable when using cloud backend.
State storage is handled automatically by Terraform Cloud and so the state
State storage is handled automatically by cloud backend and so the state
storage location is not configurable.
`
@ -1215,9 +1215,9 @@ storage location is not configurable.
Error: Invalid command-line option
The -force-copy option is for migration between state backends only, and is
not applicable when using Terraform Cloud.
not applicable when using cloud backend.
Terraform Cloud migration has additional steps, configured by interactive
Cloud backend migration has additional steps, configured by interactive
prompts.
`

View File

@ -113,7 +113,7 @@ value was set to null in a collection.
*Quick note on the go-cty Value and Type objects:* The `Before` and `After`
fields are actually go-cty values, but we cannot convert them directly because
of the Terraform Cloud redacted endpoint. The redacted endpoint turns sensitive
of the cloud backend redacted endpoint. The redacted endpoint turns sensitive
values into strings regardless of their types. Because of this, we cannot just
do a direct conversion using the ctyjson package. We would have to iterate
through the schema first, find the sensitive values and their mapped types,

View File

@ -314,12 +314,12 @@ func (c *LoginCommand) outputDefaultTFELoginSuccess(dispHostname string) {
func (c *LoginCommand) outputDefaultTFCLoginSuccess() {
c.Ui.Output(c.Colorize().Color(strings.TrimSpace(`
[green][bold]Success![reset] [bold]Logged in to Terraform Cloud[reset]
[green][bold]Success![reset] [bold]Logged in to cloud backend[reset]
` + "\n")))
}
func (c *LoginCommand) logMOTDError(err error) {
log.Printf("[TRACE] login: An error occurred attempting to fetch a message of the day for Terraform Cloud: %s", err)
log.Printf("[TRACE] login: An error occurred attempting to fetch a message of the day for cloud backend: %s", err)
}
// Help implements cli.Command.

View File

@ -136,7 +136,7 @@ func TestLogin(t *testing.T) {
if got, want := creds.Token(), "good-token"; got != want {
t.Errorf("wrong token %q; want %q", got, want)
}
if got, want := ui.OutputWriter.String(), "Welcome to Terraform Cloud!"; !strings.Contains(got, want) {
if got, want := ui.OutputWriter.String(), "Welcome to the cloud backend!"; !strings.Contains(got, want) {
t.Errorf("expected output to contain %q, but was:\n%s", want, got)
}
}))

View File

@ -630,10 +630,10 @@ func (m *Meta) backendFromConfig(opts *BackendOpts) (backend.Backend, tfdiags.Di
log.Printf("[TRACE] Meta.Backend: moving from default local state only to %q backend", c.Type)
if !opts.Init {
if c.Type == "cloud" {
initReason := "Initial configuration of Terraform Cloud"
initReason := "Initial configuration of cloud backend"
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud initialization required: please run \"tofu init\"",
"Cloud backend initialization required: please run \"tofu init\"",
fmt.Sprintf(strings.TrimSpace(errBackendInitCloud), initReason),
))
} else {
@ -731,11 +731,11 @@ func (m *Meta) determineInitReason(previousBackendType string, currentBackendTyp
initReason := ""
switch cloudMode {
case cloud.ConfigMigrationIn:
initReason = fmt.Sprintf("Changed from backend %q to Terraform Cloud", previousBackendType)
initReason = fmt.Sprintf("Changed from backend %q to cloud backend", previousBackendType)
case cloud.ConfigMigrationOut:
initReason = fmt.Sprintf("Changed from Terraform Cloud to backend %q", previousBackendType)
initReason = fmt.Sprintf("Changed from cloud backend to backend %q", previousBackendType)
case cloud.ConfigChangeInPlace:
initReason = "Terraform Cloud configuration block has changed"
initReason = "Cloud backend configuration block has changed"
default:
switch {
case previousBackendType != currentBackendType:
@ -750,13 +750,13 @@ func (m *Meta) determineInitReason(previousBackendType string, currentBackendTyp
case cloud.ConfigChangeInPlace:
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud initialization required: please run \"tofu init\"",
"Cloud backend initialization required: please run \"tofu init\"",
fmt.Sprintf(strings.TrimSpace(errBackendInitCloud), initReason),
))
case cloud.ConfigMigrationIn:
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud initialization required: please run \"tofu init\"",
"Cloud backend initialization required: please run \"tofu init\"",
fmt.Sprintf(strings.TrimSpace(errBackendInitCloud), initReason),
))
default:
@ -892,7 +892,7 @@ func (m *Meta) backend_c_r_S(
backendType := s.Backend.Type
if cloudMode == cloud.ConfigMigrationOut {
m.Ui.Output("Migrating from Terraform Cloud to local state.")
m.Ui.Output("Migrating from cloud backend to local state.")
} else {
m.Ui.Output(fmt.Sprintf(strings.TrimSpace(outputBackendMigrateLocal), s.Backend.Type))
}
@ -1138,11 +1138,11 @@ func (m *Meta) backend_C_r_S_changed(c *configs.Backend, cHash int, sMgr *clista
// Notify the user
switch cloudMode {
case cloud.ConfigChangeInPlace:
m.Ui.Output("Terraform Cloud configuration has changed.")
m.Ui.Output("Cloud backend configuration has changed.")
case cloud.ConfigMigrationIn:
m.Ui.Output(fmt.Sprintf("Migrating from backend %q to Terraform Cloud.", s.Backend.Type))
m.Ui.Output(fmt.Sprintf("Migrating from backend %q to cloud backend.", s.Backend.Type))
case cloud.ConfigMigrationOut:
m.Ui.Output(fmt.Sprintf("Migrating from Terraform Cloud to backend %q.", c.Type))
m.Ui.Output(fmt.Sprintf("Migrating from cloud backend to backend %q.", c.Type))
default:
if s.Backend.Type != c.Type {
output := fmt.Sprintf(outputBackendMigrateChange, s.Backend.Type, c.Type)
@ -1500,19 +1500,19 @@ func (m *Meta) remoteVersionCheck(b backend.Backend, workspace string) tfdiags.D
func (m *Meta) assertSupportedCloudInitOptions(mode cloud.ConfigChangeMode) tfdiags.Diagnostics {
var diags tfdiags.Diagnostics
if mode.InvolvesCloud() {
log.Printf("[TRACE] Meta.Backend: Terraform Cloud mode initialization type: %s", mode)
log.Printf("[TRACE] Meta.Backend: Cloud backend mode initialization type: %s", mode)
if m.reconfigure {
if mode.IsCloudMigration() {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Invalid command-line option",
"The -reconfigure option is unsupported when migrating to Terraform Cloud, because activating Terraform Cloud involves some additional steps.",
"The -reconfigure option is unsupported when migrating to cloud backend, because activating cloud backend involves some additional steps.",
))
} else {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Invalid command-line option",
"The -reconfigure option is for in-place reconfiguration of state backends only, and is not needed when changing Terraform Cloud settings.\n\nWhen using Terraform Cloud, initialization automatically activates any new Cloud configuration settings.",
"The -reconfigure option is for in-place reconfiguration of state backends only, and is not needed when changing cloud backend settings.\n\nWhen using cloud backend, initialization automatically activates any new Cloud configuration settings.",
))
}
}
@ -1529,13 +1529,13 @@ func (m *Meta) assertSupportedCloudInitOptions(mode cloud.ConfigChangeMode) tfdi
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Invalid command-line option",
fmt.Sprintf("The %s option is for migration between state backends only, and is not applicable when using Terraform Cloud.\n\nTerraform Cloud migration has additional steps, configured by interactive prompts.", name),
fmt.Sprintf("The %s option is for migration between state backends only, and is not applicable when using cloud backend.\n\nCloud backend migration has additional steps, configured by interactive prompts.", name),
))
} else {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Invalid command-line option",
fmt.Sprintf("The %s option is for migration between state backends only, and is not applicable when using Terraform Cloud.\n\nState storage is handled automatically by Terraform Cloud and so the state storage location is not configurable.", name),
fmt.Sprintf("The %s option is for migration between state backends only, and is not applicable when using cloud backend.\n\nState storage is handled automatically by cloud backend and so the state storage location is not configurable.", name),
))
}
}
@ -1629,7 +1629,7 @@ configuration or state have been made.
const errBackendInitCloud = `
Reason: %s.
Changes to the Terraform Cloud configuration block require reinitialization, to discover any changes to the available workspaces.
Changes to the cloud backend configuration block require reinitialization, to discover any changes to the available workspaces.
To re-initialize, run:
tofu init
@ -1663,11 +1663,11 @@ has changed. OpenTofu will now check for existing state in the backends.
const inputCloudInitCreateWorkspace = `
There are no workspaces with the configured tags (%s)
in your Terraform Cloud organization. To finish initializing, OpenTofu needs at
in your cloud backend organization. To finish initializing, OpenTofu needs at
least one workspace available.
OpenTofu can create a properly tagged workspace for you now. Please enter a
name to create a new Terraform Cloud workspace.
name to create a new cloud backend workspace.
`
const successBackendUnset = `

View File

@ -464,7 +464,7 @@ func (m *Meta) backendMigrateEmptyConfirm(source, destination statemgr.Full, opt
if opts.DestinationType == "cloud" {
inputOpts = &tofu.InputOpts{
Id: "backend-migrate-copy-to-empty-cloud",
Query: "Do you want to copy existing state to Terraform Cloud?",
Query: "Do you want to copy existing state to cloud backend?",
Description: fmt.Sprintf(strings.TrimSpace(inputBackendMigrateEmptyCloud), opts.SourceType),
}
} else {
@ -514,7 +514,7 @@ func (m *Meta) backendMigrateNonEmptyConfirm(
if opts.DestinationType == "cloud" {
inputOpts = &tofu.InputOpts{
Id: "backend-migrate-to-tfc",
Query: "Do you want to copy existing state to Terraform Cloud?",
Query: "Do you want to copy existing state to cloud backend?",
Description: fmt.Sprintf(
strings.TrimSpace(inputBackendMigrateNonEmptyCloud),
opts.SourceType, sourcePath, destinationPath),
@ -882,7 +882,7 @@ func (m *Meta) promptNewWorkspaceName(destinationType string) (string, error) {
log.Print("[TRACE] backendMigrateState: can't prompt for input, so aborting migration")
return "", errors.New(strings.TrimSpace(errInteractiveInputDisabled))
}
message = `[reset][bold][yellow]Terraform Cloud requires all workspaces to be given an explicit name.[reset]`
message = `[reset][bold][yellow]Cloud backend requires all workspaces to be given an explicit name.[reset]`
}
name, err := m.UIInput().Input(context.Background(), &tofu.InputOpts{
Id: "new-state-name",
@ -980,7 +980,7 @@ the error above and try again.
`
const errTFCMigrateNotYetImplemented = `
Migrating state from Terraform Cloud to another backend is not yet implemented.
Migrating state from cloud backend to another backend is not yet implemented.
`
const errInteractiveInputDisabled = `
@ -999,11 +999,11 @@ For example, if a workspace is currently named 'prod', the pattern 'app-*' would
const tfcInputBackendMigrateMultiToMulti = `
Unlike typical OpenTofu workspaces representing an environment associated with a particular
configuration (e.g. production, staging, development), Terraform Cloud workspaces are named uniquely
configuration (e.g. production, staging, development), cloud backend workspaces are named uniquely
across all configurations used within an organization. A typical strategy to start with is
<COMPONENT>-<ENVIRONMENT>-<REGION> (e.g. networking-prod-us-east, networking-staging-us-east).
When migrating existing workspaces from the backend %[1]q to Terraform Cloud, would you like to
When migrating existing workspaces from the backend %[1]q to cloud backend, would you like to
rename your workspaces? Enter 1 or 2.
1. Yes, I'd like to rename all workspaces according to a pattern I will provide.
@ -1011,7 +1011,7 @@ rename your workspaces? Enter 1 or 2.
`
const tfcInputBackendMigrateMultiToSingle = `
The previous backend %[1]q has multiple workspaces, but Terraform Cloud has
The previous backend %[1]q has multiple workspaces, but cloud backend has
been configured to use a single workspace (%[2]q). By continuing, you will
only migrate your current workspace. If you wish to migrate all workspaces
from the previous backend, you may cancel this operation and use the 'tags'
@ -1021,27 +1021,27 @@ Enter "yes" to proceed or "no" to cancel.
`
const tfcInputBackendMigrateStateSingleToCloudSingle = `
As part of migrating to Terraform Cloud, OpenTofu can optionally copy your
current workspace state to the configured Terraform Cloud workspace.
As part of migrating to cloud backend, OpenTofu can optionally copy your
current workspace state to the configured cloud backend workspace.
Answer "yes" to copy the latest state snapshot to the configured
Terraform Cloud workspace.
cloud backend workspace.
Answer "no" to ignore the existing state and just activate the configured
Terraform Cloud workspace with its existing state, if any.
cloud backend workspace with its existing state, if any.
Should OpenTofu migrate your existing state?
`
const tfcInputBackendMigrateRemoteMultiToCloud = `
When migrating from the 'remote' backend to OpenTofu's native integration
with Terraform Cloud, OpenTofu will automatically create or use existing
with cloud backend, OpenTofu will automatically create or use existing
workspaces based on the previous backend configuration's 'prefix' value.
When the migration is complete, workspace names in OpenTofu will match the
fully qualified Terraform Cloud workspace name. If necessary, the workspace
fully qualified cloud backend workspace name. If necessary, the workspace
tags configured in the 'cloud' option block will be added to the associated
Terraform Cloud workspaces.
cloud backend workspaces.
Enter "yes" to proceed or "no" to cancel.
`
@ -1054,8 +1054,8 @@ backend? Enter "yes" to copy and "no" to start with an empty state.
`
const inputBackendMigrateEmptyCloud = `
Pre-existing state was found while migrating the previous %q backend to Terraform Cloud.
No existing state was found in Terraform Cloud. Do you want to copy this state to Terraform Cloud?
Pre-existing state was found while migrating the previous %q backend to cloud backend.
No existing state was found in cloud backend. Do you want to copy this state to cloud backend?
Enter "yes" to copy and "no" to start with an empty state.
`
@ -1075,15 +1075,15 @@ configured %[2]q backend.
const inputBackendMigrateNonEmptyCloud = `
Pre-existing state was found while migrating the previous %q backend to
Terraform Cloud. An existing non-empty state already exists in Terraform Cloud.
cloud backend. An existing non-empty state already exists in cloud backend.
The two states have been saved to temporary files that will be removed after
responding to this query.
Previous (type %[1]q): %[2]s
New (Terraform Cloud): %[3]s
New (cloud backend): %[3]s
Do you want to overwrite the state in Terraform Cloud with the previous state?
Enter "yes" to copy and "no" to start with the existing state in Terraform Cloud.
Do you want to overwrite the state in cloud backend with the previous state?
Enter "yes" to copy and "no" to start with the existing state in cloud backend.
`
const inputBackendMigrateMultiToSingle = `

View File

@ -11,7 +11,7 @@ import (
const (
goodToken = "good-token"
accountDetails = `{"data":{"id":"user-abc123","type":"users","attributes":{"username":"testuser","email":"testuser@example.com"}}}`
MOTD = `{"msg":"Welcome to Terraform Cloud!"}`
MOTD = `{"msg":"Welcome to the cloud backend!"}`
)
// Handler is an implementation of net/http.Handler that provides a stub

View File

@ -221,8 +221,8 @@ func (m *Module) appendFile(file *File) hcl.Diagnostics {
if m.CloudConfig != nil {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Duplicate Terraform Cloud configurations",
Detail: fmt.Sprintf("A module may have only one 'cloud' block configuring Terraform Cloud. Terraform Cloud was previously configured at %s.", m.CloudConfig.DeclRange),
Summary: "Duplicate cloud configurations",
Detail: fmt.Sprintf("A module may have only one 'cloud' block configuring a cloud backend. A cloud backend was previously configured at %s.", m.CloudConfig.DeclRange),
Subject: &c.DeclRange,
})
continue
@ -234,8 +234,8 @@ func (m *Module) appendFile(file *File) hcl.Diagnostics {
if m.Backend != nil && m.CloudConfig != nil {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Both a backend and Terraform Cloud configuration are present",
Detail: fmt.Sprintf("A module may declare either one 'cloud' block configuring Terraform Cloud OR one 'backend' block configuring a state backend. Terraform Cloud is configured at %s; a backend is configured at %s. Remove the backend block to configure Terraform Cloud.", m.CloudConfig.DeclRange, m.Backend.DeclRange),
Summary: "Both a backend and a cloud configuration are present",
Detail: fmt.Sprintf("A module may declare either one 'cloud' block configuring a cloud backend OR one 'backend' block configuring a state backend. A cloud backend is configured at %s; a backend is configured at %s. Remove the backend block to configure a cloud backend.", m.CloudConfig.DeclRange, m.Backend.DeclRange),
Subject: &m.Backend.DeclRange,
})
}
@ -507,8 +507,8 @@ func (m *Module) mergeFile(file *File) hcl.Diagnostics {
// though it can override cloud/backend blocks from _other_ files.
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Duplicate Terraform Cloud configurations",
Detail: fmt.Sprintf("A module may have only one 'cloud' block configuring Terraform Cloud. Terraform Cloud was previously configured at %s.", file.CloudConfigs[0].DeclRange),
Summary: "Duplicate cloud configurations",
Detail: fmt.Sprintf("A module may have only one 'cloud' block configuring a cloud backend. A cloud backend was previously configured at %s.", file.CloudConfigs[0].DeclRange),
Subject: &file.CloudConfigs[1].DeclRange,
})
}

View File

@ -411,7 +411,7 @@ func TestModule_cloud_override(t *testing.T) {
func TestModule_cloud_duplicate_overrides(t *testing.T) {
_, diags := testModuleFromDir("testdata/invalid-modules/override-cloud-duplicates")
want := `Duplicate Terraform Cloud configurations`
want := `Duplicate cloud configurations`
if got := diags.Error(); !strings.Contains(got, want) {
t.Fatalf("expected module error to contain %q\nerror was:\n%s", want, got)
}