// GetSchema returns the config schema for the main provider
// configuration, as would appear in a "provider" block in the
// configuration files.
//
// Currently not all providers support schema. Callers must therefore
// first call Resources and DataSources and ensure that at least one
// resource or data source has the SchemaAvailable flag set.
GetSchema returns the config schema for the main provider
configuration, as would appear in a "provider" block in the
configuration files.

Currently not all providers support schema. Callers must therefore
first call Resources and DataSources and ensure that at least one
resource or data source has the SchemaAvailable flag set.
// GetSchema returns the config schema for the main provider // configuration as would appear in a " provider " block in the // configuration files . // // Currently not all providers support schema . Callers must therefore // first call Resources and DataSources and ensure that at least one // resource or data source has the SchemaAvailable flag set .
func (p *Provider) GetSchema(req *terraform.ProviderSchemaRequest) (*terraform.ProviderSchema, error) {
	resourceTypes := map[string]*configschema.Block{}
	dataSources := map[string]*configschema.Block{}
	for _, name := range req.ResourceTypes {
		if r, exists := p.ResourcesMap[name]; exists {
			resourceTypes[name] = r.CoreConfigSchema()
		}
	}
	for _, name := range req.DataSources {
		if r, exists := p.DataSourcesMap[name]; exists {
			dataSources[name] = r.CoreConfigSchema()
		}
	}
	return &terraform.ProviderSchema{
		Provider:      schemaMap(p.Schema).CoreConfigSchema(),
		ResourceTypes: resourceTypes,
		DataSources:   dataSources,
	}, nil
}
func ( p * Provider ) GetSchema ( req * terraform . ProviderSchemaRequest ) ( * terraform . ProviderSchema , error ) { resourceTypes := map [ string ] * configschema . Block { } dataSources := map [ string ] * configschema . Block { } for _ , name := range req . ResourceTypes { if r , exists := p . ResourcesMap [ name ] ; exists { resourceTypes [ name ] = r . CoreConfigSchema ( ) } } for _ , name := range req . DataSources { if r , exists := p . DataSourcesMap [ name ] ; exists { dataSources [ name ] = r . CoreConfigSchema ( ) } } return & terraform . ProviderSchema { Provider : schemaMap ( p . Schema ) . CoreConfigSchema ( ) , ResourceTypes : resourceTypes , DataSources : dataSources , } , nil }
GetSchema returns the config schema for the main provider
configuration, as would appear in a "provider" block in the
configuration files.
GetSchema returns the config schema for the main provider configuration as would appear in a " provider " block in the configuration files .