Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove user-facing mentions of Hashi TFE/TFC #154

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/backend/remote/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ func (b *Remote) Configure(obj cty.Value) tfdiags.Diagnostics {
if err != nil {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to create the Terraform Enterprise client",
"Failed to create the remote backend client",
fmt.Sprintf(
`The "remote" backend encountered an unexpected error while creating the `+
`Terraform Enterprise client: %s.`, err,
`remote backend client: %s.`, err,
),
))
return diags
Expand Down Expand Up @@ -487,7 +487,7 @@ func (b *Remote) checkConstraints(c *disco.Constraints) tfdiags.Diagnostics {

summary := fmt.Sprintf("Incompatible OpenTF version v%s", v.String())
details := fmt.Sprintf(
"The configured OpenTF Enterprise backend is compatible with OpenTF "+
"The configured remote backend is compatible with OpenTF "+
"versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding,
)

Expand Down
36 changes: 18 additions & 18 deletions internal/cloud/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
genericHostname = "localterraform.com"
)

// Cloud is an implementation of EnhancedBackend in service of the Terraform Cloud/Enterprise
// Cloud is an implementation of EnhancedBackend in service of the cloud backend
// integration for Terraform CLI. This backend is not intended to be surfaced at the user level and
// is instead an implementation detail of cloud.Cloud.
type Cloud struct {
Expand All @@ -60,16 +60,16 @@ type Cloud struct {
// Operation. See Operation for more details.
ContextOpts *terraform.ContextOpts

// client is the Terraform Cloud/Enterprise API client.
// client is the cloud backend API client.
client *tfe.Client

// lastRetry is set to the last time a request was retried.
lastRetry time.Time

// hostname of Terraform Cloud or Terraform Enterprise
// hostname of cloud backend
hostname string

// token for Terraform Cloud or Terraform Enterprise
// token for cloud backend
token string

// organization is the organization that contains the target workspaces.
Expand Down Expand Up @@ -244,7 +244,7 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
return diagErr
}

// Discover the service URL to confirm that it provides the Terraform Cloud/Enterprise API
// Discover the service URL to confirm that it provides the cloud backend API
service, err := b.discover()

// Check for errors before we continue.
Expand Down Expand Up @@ -317,10 +317,10 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
if err != nil {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to create the Terraform Cloud/Enterprise client",
"Failed to create the cloud backend client",
fmt.Sprintf(
`Encountered an unexpected error while creating the `+
`Terraform Cloud/Enterprise client: %s.`, err,
`Terraform cloud backend client: %s.`, err,
),
))
return diags
Expand Down Expand Up @@ -373,15 +373,15 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
diags = diags.Append(
tfdiags.Sourceless(
tfdiags.Error,
"Unsupported Terraform Enterprise version",
"Unsupported cloud backend version",
cloudIntegrationUsedInUnsupportedTFE,
),
)
} else {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Unsupported Terraform Enterprise version",
`The 'cloud' option is not supported with this version of Terraform Enterprise.`,
"Unsupported cloud backend version",
`The 'cloud' option is not supported with this version of the cloud backend.`,
),
)
}
Expand Down Expand Up @@ -679,7 +679,7 @@ func (b *Cloud) StateMgr(name string) (statemgr.Full, error) {
Name: b.WorkspaceMapping.Project,
}
// didn't find project, create it instead
log.Printf("[TRACE] cloud: Creating Terraform Cloud project %s/%s", b.organization, b.WorkspaceMapping.Project)
log.Printf("[TRACE] cloud: Creating cloud backend project %s/%s", b.organization, b.WorkspaceMapping.Project)
project, err := b.client.Projects.Create(context.Background(), b.organization, createOpts)
if err != nil && err != tfe.ErrResourceNotFound {
return nil, fmt.Errorf("failed to create project %s: %v", b.WorkspaceMapping.Project, err)
Expand All @@ -690,7 +690,7 @@ func (b *Cloud) StateMgr(name string) (statemgr.Full, error) {
}

// Create a workspace
log.Printf("[TRACE] cloud: Creating Terraform Cloud workspace %s/%s", b.organization, name)
log.Printf("[TRACE] cloud: Creating cloud backend workspace %s/%s", b.organization, name)
workspace, err = b.client.Workspaces.Create(context.Background(), b.organization, workspaceCreateOptions)
if err != nil {
return nil, fmt.Errorf("error creating workspace %s: %v", name, err)
Expand All @@ -713,7 +713,7 @@ func (b *Cloud) StateMgr(name string) (statemgr.Full, error) {
// object to do a nicely formatted message, so we're just assuming the
// issue was that the version wasn't available since that's probably what
// happened.
log.Printf("[TRACE] cloud: Attempted to select version %s for TFC workspace; unavailable, so %s will be used instead.", tfversion.String(), workspace.TerraformVersion)
log.Printf("[TRACE] cloud: Attempted to select version %s for cloud backend workspace; unavailable, so %s will be used instead.", tfversion.String(), workspace.TerraformVersion)
if b.CLI != nil {
versionUnavailable := fmt.Sprintf(unavailableTerraformVersion, tfversion.String(), workspace.TerraformVersion)
b.CLI.Output(b.Colorize().Color(versionUnavailable))
Expand All @@ -725,7 +725,7 @@ func (b *Cloud) StateMgr(name string) (statemgr.Full, error) {
options := tfe.WorkspaceAddTagsOptions{
Tags: b.WorkspaceMapping.tfeTags(),
}
log.Printf("[TRACE] cloud: Adding tags for Terraform Cloud workspace %s/%s", b.organization, name)
log.Printf("[TRACE] cloud: Adding tags for cloud backend workspace %s/%s", b.organization, name)
err = b.client.Workspaces.AddTags(context.Background(), workspace.ID, options)
if err != nil {
return nil, fmt.Errorf("Error updating workspace %s: %v", name, err)
Expand Down Expand Up @@ -797,7 +797,7 @@ func (b *Cloud) Operation(ctx context.Context, op *backend.Operation) (*backend.
f = b.opApply
default:
return nil, fmt.Errorf(
"\n\nTerraform Cloud does not support the %q operation.", op.Type)
"\n\nThe cloud backend does not support the %q operation.", op.Type)
}

// Lock
Expand Down Expand Up @@ -1269,7 +1269,7 @@ organization does not have access to it. The new workspace will use %s. You can
change this later in the workspace settings.[reset]`

const cloudIntegrationUsedInUnsupportedTFE = `
This version of Terraform Cloud/Enterprise does not support the state mechanism
This version of cloud backend does not support the state mechanism
attempting to be used by the platform. This should never happen.

Please reach out to OpenTF Support to resolve this issue.`
Expand All @@ -1283,12 +1283,12 @@ configuration to workspaces within a Terraform Cloud organization. Two strategie

[bold]name[reset] - %s`, schemaDescriptionTags, schemaDescriptionName)

schemaDescriptionHostname = `The Terraform Enterprise hostname to connect to. This optional argument defaults to app.terraform.io
schemaDescriptionHostname = `The cloud backend hostname to connect to. This optional argument defaults to app.terraform.io
for use with Terraform Cloud.`

schemaDescriptionOrganization = `The name of the organization containing the targeted workspace(s).`

schemaDescriptionToken = `The token used to authenticate with Terraform Cloud/Enterprise. Typically this argument should not
schemaDescriptionToken = `The token used to authenticate with the cloud backend. Typically this argument should not
be set, and 'opentf login' used instead; your credentials will then be fetched from your CLI
configuration file or configured credential helper.`

Expand Down
2 changes: 1 addition & 1 deletion internal/cloud/backend_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (b *Cloud) opApply(stopCtx, cancelCtx context.Context, op *backend.Operatio
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Saved plan is for a different hostname",
fmt.Sprintf("The given saved plan refers to a run on %s, but the currently configured Terraform Cloud or Terraform Enterprise instance is %s.", cp.Hostname, b.hostname),
fmt.Sprintf("The given saved plan refers to a run on %s, but the currently configured cloud backend instance is %s.", cp.Hostname, b.hostname),
))
return r, diags.Err()
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cloud/backend_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (b *Cloud) AssertImportCompatible(config *configs.Config) error {
}
desiredAPIVersion, _ := version.NewVersion("2.6")
if currentAPIVersion.LessThan(desiredAPIVersion) {
return fmt.Errorf("Import blocks are not supported in this version of Terraform Enterprise. Please remove any import blocks from your config or upgrade Terraform Enterprise.")
return fmt.Errorf("Import blocks are not supported in this version of the cloud backend. Please remove any import blocks from your config or upgrade the cloud backend.")
}

// Second, check the agent version is high enough.
Expand Down
4 changes: 2 additions & 2 deletions internal/cloud/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ func TestCloud_configVerifyMinimumTFEVersion(t *testing.T) {
t.Fatalf("expected configure to error")
}

expected := `The 'cloud' option is not supported with this version of Terraform Enterprise.`
expected := `The 'cloud' option is not supported with this version of the cloud backend.`
if !strings.Contains(confDiags.Err().Error(), expected) {
t.Fatalf("expected configure to error with %q, got %q", expected, confDiags.Err().Error())
}
Expand Down Expand Up @@ -766,7 +766,7 @@ func TestCloud_configVerifyMinimumTFEVersionInAutomation(t *testing.T) {
t.Fatalf("expected configure to error")
}

expected := `This version of Terraform Cloud/Enterprise does not support the state mechanism
expected := `This version of cloud backend does not support the state mechanism
attempting to be used by the platform. This should never happen.`
if !strings.Contains(confDiags.Err().Error(), expected) {
t.Fatalf("expected configure to error with %q, got %q", expected, confDiags.Err().Error())
Expand Down
2 changes: 1 addition & 1 deletion internal/command/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (c *LoginCommand) outputDefaultTFELoginSuccess(dispHostname string) {
c.Ui.Output(
fmt.Sprintf(
c.Colorize().Color(strings.TrimSpace(`
[green][bold]Success![reset] [bold]Logged in to Terraform Enterprise (%s)[reset]
[green][bold]Success![reset] [bold]Logged in to the cloud backend (%s)[reset]
`)),
dispHostname,
) + "\n",
Expand Down
2 changes: 1 addition & 1 deletion internal/command/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func TestLogin(t *testing.T) {
t.Errorf("wrong token %q; want %q", got, want)
}

if got, want := ui.OutputWriter.String(), "Logged in to Terraform Enterprise"; !strings.Contains(got, want) {
if got, want := ui.OutputWriter.String(), "Logged in to the cloud backend"; !strings.Contains(got, want) {
t.Errorf("expected output to contain %q, but was:\n%s", want, got)
}
}))
Expand Down
2 changes: 1 addition & 1 deletion internal/command/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (c *PushCommand) Run(args []string) int {
c.showDiagnostics(tfdiags.Sourceless(
tfdiags.Error,
"Command \"terraform push\" is no longer supported",
"This command was used to push configuration to Terraform Enterprise legacy (v1), which has now reached end-of-life. To push configuration to Terraform Enterprise v2, use its REST API. Contact Terraform Enterprise support for more information.",
"This command was used to push configuration to Terraform Enterprise legacy (v1), which has now reached end-of-life. To push configuration to a new cloud backend, use its REST API.",
))
return 1
}
Expand Down
2 changes: 0 additions & 2 deletions website/docs/language/state/remote-state-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ from some other Terraform configuration.

You can use the `terraform_remote_state` data source without requiring or configuring a provider. It is always available through a built-in provider with the [source address](/terraform/language/providers/requirements#source-addresses) `terraform.io/builtin/terraform`. That provider does not include any other resources or data sources.

~> **Important:** We recommend using the [`tfe_outputs` data source](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/outputs) in the [Terraform Cloud/Enterprise Provider](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs) to access remote state outputs in Terraform Cloud or Terraform Enterprise. The `tfe_outputs` data source is more secure because it does not require full access to workspace state to fetch outputs.

## Alternative Ways to Share Data Between Configurations

Sharing data with root module outputs is convenient, but it has drawbacks.
Expand Down