INNER CODE UNIT · Go

NewExternalDataSource

hashicorp/terraform-provider-external · internal/provider/data_source.go:29

func NewExternalDataSource() datasource.DataSource {
	return &externalDataSource{}
}

type externalDataSource struct{}

func (n *externalDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
	resp.TypeName = req.ProviderTypeName
}

func (n *externalDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
	resp.Schema = schema.Schema{
		Description: "The `external` data source allows an external program implementing a specific protocol " +
			"(defined below) to act as a data source, exposing arbitrary data for use elsewhere in the Terraform " +
			"configuration.\n" +
			"\n" +
			"**Warning** This mechanism is provided as an \"escape hatch\" for exceptional situations where a " +
			"first-class Terraform provider is not more appropriate. Its capabilities are limited in comparison " +

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…