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.
This commit is contained in:
Chris Arcand 2021-08-24 14:34:34 -05:00
parent a4c24e3147
commit fccc873a3d
1 changed files with 10 additions and 0 deletions

View File

@ -371,6 +371,16 @@ func (c *InitCommand) initBackend(root *configs.Module, extraConfig rawFlags) (b
var backendConfigOverride hcl.Body var backendConfigOverride hcl.Body
if root.Backend != nil { if root.Backend != nil {
backendType := root.Backend.Type 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) bf := backendInit.Backend(backendType)
if bf == nil { if bf == nil {
diags = diags.Append(&hcl.Diagnostic{ diags = diags.Append(&hcl.Diagnostic{