opentofu/builtin/providers/template/provider.go
Martin Atkins 861ac536dd provider/template: convert resources to data sources
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.
2016-07-08 17:11:17 +01:00

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(),
),
},
}
}