Package datasource contains all interfaces, request types, and response types for a data source implementation.
In Terraform, a data source is a concept which enables provider developers to offer practitioners a read-only source of information, which is saved into the Terraform state and can be referenced by other parts of a configuration. Data sources are defined by a data source type/name, such as "examplecloud_thing", a schema representing the structure and data types of configuration and state, and read logic.
The main starting point for implementations in this package is the DataSource type which represents an instance of a data source type that has its own configuration, read logic, and state. The DataSource implementations are referenced by a [provider.Provider] type DataSources method, which enables the data source for practitioner and testing usage.
This section is empty.
This section is empty.
This section is empty.
ConfigValidator describes reusable data source configuration validation functionality.
type ConfigureRequest struct { ProviderData any }
ConfigureRequest represents a request for the provider to configure a data source, i.e., set provider-level data or clients. An instance of this request struct is supplied as an argument to the DataSource type Configure method.
ConfigureResponse represents a response to a ConfigureRequest. An instance of this response struct is supplied as an argument to the DataSource type Configure method.
DataSource represents an instance of a data source type. This is the core interface that all data sources must implement.
Data sources can optionally implement these additional concepts:
DataSourceWithConfigValidators is an interface type that extends DataSource to include declarative validations.
Declaring validation using this methodology simplifies implmentation of reusable functionality. These also include descriptions, which can be used for automating documentation.
Validation will include ConfigValidators and ValidateConfig, if both are implemented, in addition to any Attribute or Type validation.
DataSourceWithConfigure is an interface type that extends DataSource to include a method which the framework will automatically call so provider developers have the opportunity to setup any necessary provider-level data or clients in the DataSource type.
This method is intended to replace the provider.DataSourceType type NewDataSource method in a future release.
DataSourceWithValidateConfig is an interface type that extends DataSource to include imperative validation.
Declaring validation using this methodology simplifies one-off functionality that typically applies to a single data source. Any documentation of this functionality must be manually added into schema descriptions.
Validation will include ConfigValidators and ValidateConfig, if both are implemented, in addition to any Attribute or Type validation.
Deferred is used to indicate to Terraform that a change needs to be deferred for a reason.
NOTE: This functionality is related to deferred action support, which is currently experimental and is subject to change or break without warning. It is not protected by version compatibility guarantees.
type DeferredReason int32
DeferredReason represents different reasons for deferring a change.
NOTE: This functionality is related to deferred action support, which is currently experimental and is subject to change or break without warning. It is not protected by version compatibility guarantees.
type MetadataRequest struct { ProviderTypeName string }
MetadataRequest represents a request for the DataSource to return metadata, such as its type name. An instance of this request struct is supplied as an argument to the DataSource type Metadata method.
type MetadataResponse struct { TypeName string }
MetadataResponse represents a response to a MetadataRequest. An instance of this response struct is supplied as an argument to the DataSource type Metadata method.
type ReadClientCapabilities struct { DeferralAllowed bool }
ReadClientCapabilities allows Terraform to publish information regarding optionally supported protocol features for the ReadDataSource RPC, such as forward-compatible Terraform behavior changes.
ReadRequest represents a request for the provider to read a data source, i.e., update values in state according to the real state of the data source. An instance of this request struct is supplied as an argument to the data source's Read function.
ReadResponse represents a response to a ReadRequest. An instance of this response struct is supplied as an argument to the data source's Read function, in which the provider should set values on the ReadResponse as appropriate.
type SchemaRequest struct{}
SchemaRequest represents a request for the DataSource to return its schema. An instance of this request struct is supplied as an argument to the DataSource type Schema method.
SchemaResponse represents a response to a SchemaRequest. An instance of this response struct is supplied as an argument to the DataSource type Schema method.
type ValidateConfigRequest struct { Config tfsdk.Config }
ValidateConfigRequest represents a request to validate the configuration of a data source. An instance of this request struct is supplied as an argument to the DataSource ValidateConfig receiver method or automatically passed through to each ConfigValidator.
ValidateConfigResponse represents a response to a ValidateConfigRequest. An instance of this response struct is supplied as an argument to the DataSource ValidateConfig receiver method or automatically passed through to each ConfigValidator.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4