From fccc873a3d714cfc1a1ec7e1e4f2392d645b57b6 Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Tue, 24 Aug 2021 14:34:34 -0500 Subject: [PATCH] Remove ability to declare a 'cloud' backend With the alternative block introduced in 7bf9b2c7b, this removes the ability to explicitly declare the 'cloud' backend. The literal backend interface is an implementation detail and no longer a user-level concept when using Terraform Cloud. --- internal/command/init.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/command/init.go b/internal/command/init.go index 8591f0c53a..d88ec181ef 100644 --- a/internal/command/init.go +++ b/internal/command/init.go @@ -371,6 +371,16 @@ func (c *InitCommand) initBackend(root *configs.Module, extraConfig rawFlags) (b var backendConfigOverride hcl.Body if root.Backend != nil { backendType := root.Backend.Type + if backendType == "cloud" { + 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), + Subject: &root.Backend.TypeRange, + }) + return nil, true, diags + } + bf := backendInit.Backend(backendType) if bf == nil { diags = diags.Append(&hcl.Diagnostic{