blob: c4b82de186cc66140f8a973608e4aab4060497ad [file] [log] [blame]
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package configs
import (
"github.com/hashicorp/hcl/v2"
)
// Cloud represents a "cloud" block inside a "terraform" block in a module
// or file.
type CloudConfig struct {
Config hcl.Body
DeclRange hcl.Range
}
func decodeCloudBlock(block *hcl.Block) (*CloudConfig, hcl.Diagnostics) {
return &CloudConfig{
Config: block.Body,
DeclRange: block.DefRange,
}, nil
}
func (c *CloudConfig) ToBackendConfig() Backend {
return Backend{
Type: "cloud",
Config: c.Config,
}
}