mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-15 19:22:46 -06:00
861ac536dd
The template resources don't actually need to retain any state, so they are good candidates to be data sources. This includes a few tweaks to the acceptance tests -- now configured to run as unit tests -- since it seems that they have been slightly broken for a while now. In particular, the "update" cases are no longer tested because updating is not a meaningful operation for a data source.
26 lines
646 B
Go
26 lines
646 B
Go
package template
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
"github.com/hashicorp/terraform/terraform"
|
|
)
|
|
|
|
func Provider() terraform.ResourceProvider {
|
|
return &schema.Provider{
|
|
DataSourcesMap: map[string]*schema.Resource{
|
|
"template_file": dataSourceFile(),
|
|
"template_cloudinit_config": dataSourceCloudinitConfig(),
|
|
},
|
|
ResourcesMap: map[string]*schema.Resource{
|
|
"template_file": schema.DataSourceResourceShim(
|
|
"template_file",
|
|
dataSourceFile(),
|
|
),
|
|
"template_cloudinit_config": schema.DataSourceResourceShim(
|
|
"template_cloudinit_config",
|
|
dataSourceCloudinitConfig(),
|
|
),
|
|
},
|
|
}
|
|
}
|