mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 08:21:07 -06:00
cb2e9119aa
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
33 lines
636 B
Go
33 lines
636 B
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
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,
|
|
}
|
|
}
|