mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
fc4fa10981
Previously resources were assumed to always support the full set of create, read, update and delete operations, and Terraform's resource management lifecycle. Data sources introduce a new kind of resource that only supports the "read" operation. To support this, a new "Mode" field is added to the Resource concept within the config layer, which can be set to ManagedResourceMode (to indicate the only mode previously possible) or DataResourceMode (to indicate that only "read" is supported). To support both managed and data resources in the tests, the stringification of resources in config_string.go is adjusted slightly to use the Id() method rather than the unusual type[name] serialization from before, causing a simple mechanical adjustment to the loader tests' expected result strings.
10 lines
199 B
Go
10 lines
199 B
Go
package config
|
|
|
|
//go:generate stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go
|
|
type ResourceMode int
|
|
|
|
const (
|
|
ManagedResourceMode ResourceMode = iota
|
|
DataResourceMode
|
|
)
|