Documentation
¶
Overview ¶
Package testprovider contains a fully declarative provider for testing.
Index ¶
- type AttributePlanModifier
- type AttributeValidator
- type DataSource
- type DataSourceConfigValidator
- type DataSourceType
- type DataSourceWithConfigValidators
- type DataSourceWithConfigValidatorsAndGetSchemaAndMetadata
- func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
- func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- type DataSourceWithConfigure
- type DataSourceWithGetSchema
- type DataSourceWithGetSchemaAndMetadata
- type DataSourceWithGetSchemaAndMetadataAndValidateConfig
- func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, ...)
- type DataSourceWithMetadata
- type DataSourceWithValidateConfig
- type Provider
- func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *Provider) DataSources(ctx context.Context) []func() datasource.DataSource
- func (p *Provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (p *Provider) Resources(ctx context.Context) []func() resource.Resource
- type ProviderConfigValidator
- type ProviderWithConfigValidators
- type ProviderWithGetDataSources
- type ProviderWithGetResources
- type ProviderWithMetaSchema
- type ProviderWithMetadata
- type ProviderWithValidateConfig
- type Resource
- func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ResourceConfigValidator
- type ResourceType
- type ResourceWithConfigValidators
- type ResourceWithConfigValidatorsAndGetSchemaAndMetadata
- func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators(ctx context.Context) []resource.ConfigValidator
- func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- type ResourceWithConfigure
- type ResourceWithConfigureAndImportState
- type ResourceWithConfigureAndModifyPlan
- type ResourceWithConfigureAndUpgradeState
- type ResourceWithGetSchema
- type ResourceWithGetSchemaAndImportStateAndMetadata
- func (r *ResourceWithGetSchemaAndImportStateAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (r *ResourceWithGetSchemaAndImportStateAndMetadata) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ResourceWithGetSchemaAndImportStateAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- type ResourceWithGetSchemaAndMetadata
- type ResourceWithGetSchemaAndMetadataAndUpgradeState
- func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
- type ResourceWithGetSchemaAndMetadataAndValidateConfig
- func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
- type ResourceWithGetSchemaAndModifyPlanAndMetadata
- func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- type ResourceWithImportState
- type ResourceWithMetadata
- type ResourceWithModifyPlan
- type ResourceWithUpgradeState
- type ResourceWithValidateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributePlanModifier ¶
type AttributePlanModifier struct {
// AttributePlanModifier interface methods
DescriptionMethod func(context.Context) string
MarkdownDescriptionMethod func(context.Context) string
ModifyMethod func(context.Context, tfsdk.ModifyAttributePlanRequest, *tfsdk.ModifyAttributePlanResponse)
}
Declarative tfsdk.AttributePlanModifier for unit testing.
func (*AttributePlanModifier) Description ¶
func (m *AttributePlanModifier) Description(ctx context.Context) string
Description satisfies the tfsdk.AttributePlanModifier interface.
func (*AttributePlanModifier) MarkdownDescription ¶
func (m *AttributePlanModifier) MarkdownDescription(ctx context.Context) string
MarkdownDescription satisfies the tfsdk.AttributePlanModifier interface.
func (*AttributePlanModifier) Modify ¶
func (m *AttributePlanModifier) Modify(ctx context.Context, req tfsdk.ModifyAttributePlanRequest, resp *tfsdk.ModifyAttributePlanResponse)
Modify satisfies the tfsdk.AttributePlanModifier interface.
type AttributeValidator ¶
type AttributeValidator struct {
// AttributeValidator interface methods
DescriptionMethod func(context.Context) string
MarkdownDescriptionMethod func(context.Context) string
ValidateMethod func(context.Context, tfsdk.ValidateAttributeRequest, *tfsdk.ValidateAttributeResponse)
}
Declarative tfsdk.AttributeValidator for unit testing.
func (*AttributeValidator) Description ¶
func (v *AttributeValidator) Description(ctx context.Context) string
Description satisfies the tfsdk.AttributeValidator interface.
func (*AttributeValidator) MarkdownDescription ¶
func (v *AttributeValidator) MarkdownDescription(ctx context.Context) string
MarkdownDescription satisfies the tfsdk.AttributeValidator interface.
func (*AttributeValidator) Validate ¶
func (v *AttributeValidator) Validate(ctx context.Context, req tfsdk.ValidateAttributeRequest, resp *tfsdk.ValidateAttributeResponse)
Validate satisfies the tfsdk.AttributeValidator interface.
type DataSource ¶
type DataSource struct {
// DataSource interface methods
ReadMethod func(context.Context, datasource.ReadRequest, *datasource.ReadResponse)
}
Declarative datasource.DataSource for unit testing.
func (*DataSource) Read ¶
func (d *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read satisfies the datasource.DataSource interface.
type DataSourceConfigValidator ¶
type DataSourceConfigValidator struct {
// DataSourceConfigValidator interface methods
DescriptionMethod func(context.Context) string
MarkdownDescriptionMethod func(context.Context) string
ValidateDataSourceMethod func(context.Context, datasource.ValidateConfigRequest, *datasource.ValidateConfigResponse)
}
Declarative datasource.ConfigValidator for unit testing.
func (*DataSourceConfigValidator) Description ¶
func (v *DataSourceConfigValidator) Description(ctx context.Context) string
Description satisfies the datasource.ConfigValidator interface.
func (*DataSourceConfigValidator) MarkdownDescription ¶
func (v *DataSourceConfigValidator) MarkdownDescription(ctx context.Context) string
MarkdownDescription satisfies the datasource.ConfigValidator interface.
func (*DataSourceConfigValidator) ValidateDataSource ¶ added in v0.10.0
func (v *DataSourceConfigValidator) ValidateDataSource(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
Validate satisfies the datasource.ConfigValidator interface.
type DataSourceType ¶
type DataSourceType struct {
// DataSourceType interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
NewDataSourceMethod func(context.Context, provider.Provider) (datasource.DataSource, diag.Diagnostics)
}
Declarative provider.DataSourceType for unit testing.
func (*DataSourceType) GetSchema ¶
func (t *DataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the provider.DataSourceType interface.
func (*DataSourceType) NewDataSource ¶
func (t *DataSourceType) NewDataSource(ctx context.Context, p provider.Provider) (datasource.DataSource, diag.Diagnostics)
NewDataSource satisfies the provider.DataSourceType interface.
type DataSourceWithConfigValidators ¶
type DataSourceWithConfigValidators struct {
*DataSource
// DataSourceWithConfigValidators interface methods
ConfigValidatorsMethod func(context.Context) []datasource.ConfigValidator
}
Declarative datasource.DataSourceWithConfigValidators for unit testing.
func (*DataSourceWithConfigValidators) ConfigValidators ¶
func (p *DataSourceWithConfigValidators) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
ConfigValidators satisfies the datasource.DataSourceWithConfigValidators interface.
type DataSourceWithConfigValidatorsAndGetSchemaAndMetadata ¶ added in v0.12.0
type DataSourceWithConfigValidatorsAndGetSchemaAndMetadata struct {
*DataSource
// DataSourceWithConfigValidators interface methods
ConfigValidatorsMethod func(context.Context) []datasource.ConfigValidator
// DataSourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// DataSourceWithMetadata interface methods
MetadataMethod func(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse)
}
Declarative datasource.DataSourceWithGetSchema for unit testing.
func (*DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators ¶ added in v0.12.0
func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
ConfigValidators satisfies the datasource.DataSourceWithConfigValidators interface.
func (*DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema ¶ added in v0.12.0
func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the datasource.DataSourceWithGetSchema interface.
func (*DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata ¶ added in v0.12.0
func (d *DataSourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata satisfies the datasource.DataSourceWithMetadata interface.
type DataSourceWithConfigure ¶ added in v0.12.0
type DataSourceWithConfigure struct {
*DataSource
// DataSourceWithConfigure interface methods
ConfigureMethod func(context.Context, datasource.ConfigureRequest, *datasource.ConfigureResponse)
}
Declarative datasource.DataSourceWithConfigure for unit testing.
func (*DataSourceWithConfigure) Configure ¶ added in v0.12.0
func (d *DataSourceWithConfigure) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure satisfies the datasource.DataSourceWithConfigure interface.
type DataSourceWithGetSchema ¶ added in v0.12.0
type DataSourceWithGetSchema struct {
*DataSource
// DataSourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
}
Declarative datasource.DataSourceWithGetSchema for unit testing.
func (*DataSourceWithGetSchema) GetSchema ¶ added in v0.12.0
func (d *DataSourceWithGetSchema) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the datasource.DataSourceWithGetSchema interface.
type DataSourceWithGetSchemaAndMetadata ¶ added in v0.12.0
type DataSourceWithGetSchemaAndMetadata struct {
*DataSource
// DataSourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// DataSourceWithMetadata interface methods
MetadataMethod func(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse)
}
Declarative datasource.DataSourceWithGetSchema for unit testing.
func (*DataSourceWithGetSchemaAndMetadata) GetSchema ¶ added in v0.12.0
func (d *DataSourceWithGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the datasource.DataSourceWithGetSchema interface.
func (*DataSourceWithGetSchemaAndMetadata) Metadata ¶ added in v0.12.0
func (d *DataSourceWithGetSchemaAndMetadata) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata satisfies the datasource.DataSourceWithMetadata interface.
type DataSourceWithGetSchemaAndMetadataAndValidateConfig ¶ added in v0.12.0
type DataSourceWithGetSchemaAndMetadataAndValidateConfig struct {
*DataSource
// DataSourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// DataSourceWithMetadata interface methods
MetadataMethod func(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse)
// DataSourceWithValidateConfig interface methods
ValidateConfigMethod func(context.Context, datasource.ValidateConfigRequest, *datasource.ValidateConfigResponse)
}
Declarative datasource.DataSourceWithGetSchema for unit testing.
func (*DataSourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema ¶ added in v0.12.0
func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the datasource.DataSourceWithGetSchema interface.
func (*DataSourceWithGetSchemaAndMetadataAndValidateConfig) Metadata ¶ added in v0.12.0
func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata satisfies the datasource.DataSourceWithMetadata interface.
func (*DataSourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig ¶ added in v0.12.0
func (d *DataSourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
ValidateConfig satisfies the datasource.DataSourceWithValidateConfig interface.
type DataSourceWithMetadata ¶ added in v0.12.0
type DataSourceWithMetadata struct {
*DataSource
// DataSourceWithMetadata interface methods
MetadataMethod func(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse)
}
Declarative datasource.DataSourceWithMetadata for unit testing.
func (*DataSourceWithMetadata) Metadata ¶ added in v0.12.0
func (d *DataSourceWithMetadata) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata satisfies the datasource.DataSourceWithMetadata interface.
type DataSourceWithValidateConfig ¶
type DataSourceWithValidateConfig struct {
*DataSource
// DataSourceWithValidateConfig interface methods
ValidateConfigMethod func(context.Context, datasource.ValidateConfigRequest, *datasource.ValidateConfigResponse)
}
Declarative datasource.DataSourceWithValidateConfig for unit testing.
func (*DataSourceWithValidateConfig) ValidateConfig ¶
func (p *DataSourceWithValidateConfig) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
ValidateConfig satisfies the datasource.DataSourceWithValidateConfig interface.
type Provider ¶
type Provider struct {
// Provider interface methods
ConfigureMethod func(context.Context, provider.ConfigureRequest, *provider.ConfigureResponse)
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ProviderWithDataSources interface methods
DataSourcesMethod func(context.Context) []func() datasource.DataSource
// ProviderWithResources interface methods
ResourcesMethod func(context.Context) []func() resource.Resource
}
Declarative provider.Provider for unit testing.
func (*Provider) Configure ¶
func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
GetSchema satisfies the provider.Provider interface.
func (*Provider) DataSources ¶ added in v0.12.0
func (p *Provider) DataSources(ctx context.Context) []func() datasource.DataSource
DataSources satisfies the provider.ProviderWithDataSources interface.
type ProviderConfigValidator ¶
type ProviderConfigValidator struct {
// ConfigValidator interface methods
DescriptionMethod func(context.Context) string
MarkdownDescriptionMethod func(context.Context) string
ValidateProviderMethod func(context.Context, provider.ValidateConfigRequest, *provider.ValidateConfigResponse)
}
Declarative provider.ConfigValidator for unit testing.
func (*ProviderConfigValidator) Description ¶
func (v *ProviderConfigValidator) Description(ctx context.Context) string
Description satisfies the provider.ConfigValidator interface.
func (*ProviderConfigValidator) MarkdownDescription ¶
func (v *ProviderConfigValidator) MarkdownDescription(ctx context.Context) string
MarkdownDescription satisfies the provider.ConfigValidator interface.
func (*ProviderConfigValidator) ValidateProvider ¶ added in v0.10.0
func (v *ProviderConfigValidator) ValidateProvider(ctx context.Context, req provider.ValidateConfigRequest, resp *provider.ValidateConfigResponse)
Validate satisfies the provider.ConfigValidator interface.
type ProviderWithConfigValidators ¶
type ProviderWithConfigValidators struct {
*Provider
// ProviderWithConfigValidators interface methods
ConfigValidatorsMethod func(context.Context) []provider.ConfigValidator
}
Declarative provider.ProviderWithConfigValidators for unit testing.
func (*ProviderWithConfigValidators) ConfigValidators ¶
func (p *ProviderWithConfigValidators) ConfigValidators(ctx context.Context) []provider.ConfigValidator
GetMetaSchema satisfies the provider.ProviderWithConfigValidators interface.
type ProviderWithGetDataSources ¶ added in v0.12.0
type ProviderWithGetDataSources struct {
*Provider
// ProviderWithGetDataSources interface methods
//nolint:staticcheck // Internal implementation
GetDataSourcesMethod func(context.Context) (map[string]provider.DataSourceType, diag.Diagnostics)
}
Declarative provider.ProviderWithGetDataSources for unit testing.
func (*ProviderWithGetDataSources) GetDataSources ¶ added in v0.12.0
func (p *ProviderWithGetDataSources) GetDataSources(ctx context.Context) (map[string]provider.DataSourceType, diag.Diagnostics)
GetDataSources satisfies the provider.ProviderWithGetDataSources interface.
type ProviderWithGetResources ¶ added in v0.12.0
type ProviderWithGetResources struct {
*Provider
// ProviderWithGetResources interface methods
//nolint:staticcheck // Internal implementation
GetResourcesMethod func(context.Context) (map[string]provider.ResourceType, diag.Diagnostics)
}
Declarative provider.ProviderWithGetResources for unit testing.
func (*ProviderWithGetResources) GetResources ¶ added in v0.12.0
func (p *ProviderWithGetResources) GetResources(ctx context.Context) (map[string]provider.ResourceType, diag.Diagnostics)
GetResources satisfies the provider.ProviderWithGetResources interface.
type ProviderWithMetaSchema ¶ added in v0.11.0
type ProviderWithMetaSchema struct {
*Provider
// ProviderWithMetaSchema interface methods
GetMetaSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
}
Declarative provider.ProviderWithMetaSchema for unit testing.
func (*ProviderWithMetaSchema) GetMetaSchema ¶ added in v0.11.0
func (p *ProviderWithMetaSchema) GetMetaSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetMetaSchema satisfies the provider.ProviderWithMetaSchema interface.
type ProviderWithMetadata ¶ added in v0.12.0
type ProviderWithMetadata struct {
*Provider
// ProviderWithMetadata interface methods
MetadataMethod func(context.Context, provider.MetadataRequest, *provider.MetadataResponse)
}
Declarative provider.ProviderWithMetadata for unit testing.
func (*ProviderWithMetadata) Metadata ¶ added in v0.12.0
func (p *ProviderWithMetadata) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse)
Metadata satisfies the provider.ProviderWithMetadata interface.
type ProviderWithValidateConfig ¶
type ProviderWithValidateConfig struct {
*Provider
// ProviderWithValidateConfig interface methods
ValidateConfigMethod func(context.Context, provider.ValidateConfigRequest, *provider.ValidateConfigResponse)
}
Declarative provider.ProviderWithValidateConfig for unit testing.
func (*ProviderWithValidateConfig) ValidateConfig ¶
func (p *ProviderWithValidateConfig) ValidateConfig(ctx context.Context, req provider.ValidateConfigRequest, resp *provider.ValidateConfigResponse)
GetMetaSchema satisfies the provider.ProviderWithValidateConfig interface.
type Resource ¶
type Resource struct {
// Resource interface methods
CreateMethod func(context.Context, resource.CreateRequest, *resource.CreateResponse)
DeleteMethod func(context.Context, resource.DeleteRequest, *resource.DeleteResponse)
ReadMethod func(context.Context, resource.ReadRequest, *resource.ReadResponse)
UpdateMethod func(context.Context, resource.UpdateRequest, *resource.UpdateResponse)
}
Declarative resource.Resource for unit testing.
func (*Resource) Create ¶
func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create satisfies the resource.Resource interface.
func (*Resource) Delete ¶
func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete satisfies the resource.Resource interface.
func (*Resource) Read ¶
func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read satisfies the resource.Resource interface.
func (*Resource) Update ¶
func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update satisfies the resource.Resource interface.
type ResourceConfigValidator ¶
type ResourceConfigValidator struct {
// ResourceConfigValidator interface methods
DescriptionMethod func(context.Context) string
MarkdownDescriptionMethod func(context.Context) string
ValidateResourceMethod func(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}
Declarative resource.ConfigValidator for unit testing.
func (*ResourceConfigValidator) Description ¶
func (v *ResourceConfigValidator) Description(ctx context.Context) string
Description satisfies the resource.ConfigValidator interface.
func (*ResourceConfigValidator) MarkdownDescription ¶
func (v *ResourceConfigValidator) MarkdownDescription(ctx context.Context) string
MarkdownDescription satisfies the resource.ConfigValidator interface.
func (*ResourceConfigValidator) ValidateResource ¶ added in v0.10.0
func (v *ResourceConfigValidator) ValidateResource(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
Validate satisfies the resource.ConfigValidator interface.
type ResourceType ¶
type ResourceType struct {
// ResourceType interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
NewResourceMethod func(context.Context, provider.Provider) (resource.Resource, diag.Diagnostics)
}
Declarative provider.ResourceType for unit testing.
func (*ResourceType) GetSchema ¶
func (t *ResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the provider.ResourceType interface.
func (*ResourceType) NewResource ¶
func (t *ResourceType) NewResource(ctx context.Context, p provider.Provider) (resource.Resource, diag.Diagnostics)
NewResource satisfies the provider.ResourceType interface.
type ResourceWithConfigValidators ¶
type ResourceWithConfigValidators struct {
*Resource
// ResourceWithConfigValidators interface methods
ConfigValidatorsMethod func(context.Context) []resource.ConfigValidator
}
Declarative resource.ResourceWithConfigValidators for unit testing.
func (*ResourceWithConfigValidators) ConfigValidators ¶
func (p *ResourceWithConfigValidators) ConfigValidators(ctx context.Context) []resource.ConfigValidator
ConfigValidators satisfies the resource.ResourceWithConfigValidators interface.
type ResourceWithConfigValidatorsAndGetSchemaAndMetadata ¶ added in v0.12.0
type ResourceWithConfigValidatorsAndGetSchemaAndMetadata struct {
*Resource
// ResourceWithConfigValidators interface methods
ConfigValidatorsMethod func(context.Context) []resource.ConfigValidator
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators ¶ added in v0.12.0
func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) ConfigValidators(ctx context.Context) []resource.ConfigValidator
ConfigValidators satisfies the resource.ResourceWithConfigValidators interface.
func (*ResourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema ¶ added in v0.12.0
func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata ¶ added in v0.12.0
func (r *ResourceWithConfigValidatorsAndGetSchemaAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
type ResourceWithConfigure ¶ added in v0.12.0
type ResourceWithConfigure struct {
*Resource
// ResourceWithConfigure interface methods
ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
}
Declarative resource.ResourceWithConfigure for unit testing.
func (*ResourceWithConfigure) Configure ¶ added in v0.12.0
func (r *ResourceWithConfigure) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure satisfies the resource.ResourceWithConfigure interface.
type ResourceWithConfigureAndImportState ¶ added in v0.12.0
type ResourceWithConfigureAndImportState struct {
*Resource
// ResourceWithConfigureAndImportState interface methods
ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
// ResourceWithImportState interface methods
ImportStateMethod func(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
}
Declarative resource.ResourceWithConfigureAndImportState for unit testing.
func (*ResourceWithConfigureAndImportState) Configure ¶ added in v0.12.0
func (r *ResourceWithConfigureAndImportState) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure satisfies the resource.ResourceWithConfigureAndImportState interface.
func (*ResourceWithConfigureAndImportState) ImportState ¶ added in v0.12.0
func (r *ResourceWithConfigureAndImportState) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState satisfies the resource.ResourceWithImportState interface.
type ResourceWithConfigureAndModifyPlan ¶ added in v0.12.0
type ResourceWithConfigureAndModifyPlan struct {
*Resource
// ResourceWithConfigureAndModifyPlan interface methods
ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
// ResourceWithModifyPlan interface methods
ModifyPlanMethod func(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
}
Declarative resource.ResourceWithConfigureAndModifyPlan for unit testing.
func (*ResourceWithConfigureAndModifyPlan) Configure ¶ added in v0.12.0
func (r *ResourceWithConfigureAndModifyPlan) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure satisfies the resource.ResourceWithConfigureAndModifyPlan interface.
func (*ResourceWithConfigureAndModifyPlan) ModifyPlan ¶ added in v0.12.0
func (r *ResourceWithConfigureAndModifyPlan) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan satisfies the resource.ResourceWithModifyPlan interface.
type ResourceWithConfigureAndUpgradeState ¶ added in v0.12.0
type ResourceWithConfigureAndUpgradeState struct {
*Resource
// ResourceWithConfigureAndUpgradeState interface methods
ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
// ResourceWithUpgradeState interface methods
UpgradeStateMethod func(context.Context) map[int64]resource.StateUpgrader
}
Declarative resource.ResourceWithConfigureAndUpgradeState for unit testing.
func (*ResourceWithConfigureAndUpgradeState) Configure ¶ added in v0.12.0
func (r *ResourceWithConfigureAndUpgradeState) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure satisfies the resource.ResourceWithConfigureAndUpgradeState interface.
func (*ResourceWithConfigureAndUpgradeState) UpgradeState ¶ added in v0.12.0
func (r *ResourceWithConfigureAndUpgradeState) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
UpgradeState satisfies the resource.ResourceWithUpgradeState interface.
type ResourceWithGetSchema ¶ added in v0.12.0
type ResourceWithGetSchema struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
}
Declarative resource.ResourceWithGetSchema for unit testing.
func (*ResourceWithGetSchema) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchema) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
type ResourceWithGetSchemaAndImportStateAndMetadata ¶ added in v0.12.0
type ResourceWithGetSchemaAndImportStateAndMetadata struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithImportState interface methods
ImportStateMethod func(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithGetSchemaAndImportStateAndMetadata) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndImportStateAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithGetSchemaAndImportStateAndMetadata) ImportState ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndImportStateAndMetadata) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState satisfies the resource.ResourceWithImportState interface.
func (*ResourceWithGetSchemaAndImportStateAndMetadata) Metadata ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndImportStateAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
type ResourceWithGetSchemaAndMetadata ¶ added in v0.12.0
type ResourceWithGetSchemaAndMetadata struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithGetSchemaAndMetadata) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithGetSchemaAndMetadata) Metadata ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
type ResourceWithGetSchemaAndMetadataAndUpgradeState ¶ added in v0.12.0
type ResourceWithGetSchemaAndMetadataAndUpgradeState struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
// ResourceWithUpgradeState interface methods
UpgradeStateMethod func(context.Context) map[int64]resource.StateUpgrader
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithGetSchemaAndMetadataAndUpgradeState) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithGetSchemaAndMetadataAndUpgradeState) Metadata ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
func (*ResourceWithGetSchemaAndMetadataAndUpgradeState) UpgradeState ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndUpgradeState) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
UpgradeState satisfies the resource.ResourceWithUpgradeState interface.
type ResourceWithGetSchemaAndMetadataAndValidateConfig ¶ added in v0.12.0
type ResourceWithGetSchemaAndMetadataAndValidateConfig struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
// ResourceWithValidateConfig interface methods
ValidateConfigMethod func(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithGetSchemaAndMetadataAndValidateConfig) Metadata ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
func (*ResourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndMetadataAndValidateConfig) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
ValidateConfig satisfies the resource.ResourceWithValidateConfig interface.
type ResourceWithGetSchemaAndModifyPlanAndMetadata ¶ added in v0.12.0
type ResourceWithGetSchemaAndModifyPlanAndMetadata struct {
*Resource
// ResourceWithGetSchema interface methods
GetSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
// ResourceWithModifyPlan interface methods
ModifyPlanMethod func(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
}
Declarative resource.ResourceWithGetSchema for unit testing. This type is temporary until GetSchema and Metadata are required in Resource.
func (*ResourceWithGetSchemaAndModifyPlanAndMetadata) GetSchema ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
GetSchema satisfies the resource.ResourceWithGetSchema interface.
func (*ResourceWithGetSchemaAndModifyPlanAndMetadata) Metadata ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
func (*ResourceWithGetSchemaAndModifyPlanAndMetadata) ModifyPlan ¶ added in v0.12.0
func (r *ResourceWithGetSchemaAndModifyPlanAndMetadata) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan satisfies the resource.ResourceWithModifyPlan interface.
type ResourceWithImportState ¶
type ResourceWithImportState struct {
*Resource
// ResourceWithImportState interface methods
ImportStateMethod func(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
}
Declarative resource.ResourceWithImportState for unit testing.
func (*ResourceWithImportState) ImportState ¶
func (p *ResourceWithImportState) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState satisfies the resource.ResourceWithImportState interface.
type ResourceWithMetadata ¶ added in v0.12.0
type ResourceWithMetadata struct {
*Resource
// ResourceWithMetadata interface methods
MetadataMethod func(context.Context, resource.MetadataRequest, *resource.MetadataResponse)
}
Declarative resource.ResourceWithMetadata for unit testing.
func (*ResourceWithMetadata) Metadata ¶ added in v0.12.0
func (r *ResourceWithMetadata) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata satisfies the resource.ResourceWithMetadata interface.
type ResourceWithModifyPlan ¶
type ResourceWithModifyPlan struct {
*Resource
// ResourceWithModifyPlan interface methods
ModifyPlanMethod func(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
}
Declarative resource.ResourceWithModifyPlan for unit testing.
func (*ResourceWithModifyPlan) ModifyPlan ¶
func (p *ResourceWithModifyPlan) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan satisfies the resource.ResourceWithModifyPlan interface.
type ResourceWithUpgradeState ¶
type ResourceWithUpgradeState struct {
*Resource
// ResourceWithUpgradeState interface methods
UpgradeStateMethod func(context.Context) map[int64]resource.StateUpgrader
}
Declarative resource.ResourceWithUpgradeState for unit testing.
func (*ResourceWithUpgradeState) UpgradeState ¶
func (p *ResourceWithUpgradeState) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
UpgradeState satisfies the resource.ResourceWithUpgradeState interface.
type ResourceWithValidateConfig ¶
type ResourceWithValidateConfig struct {
*Resource
// ResourceWithValidateConfig interface methods
ValidateConfigMethod func(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}
Declarative resource.ResourceWithValidateConfig for unit testing.
func (*ResourceWithValidateConfig) ValidateConfig ¶
func (p *ResourceWithValidateConfig) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
ValidateConfig satisfies the resource.ResourceWithValidateConfig interface.
Source Files
¶
- attributeplanmodifier.go
- attributevalidator.go
- datasource.go
- datasourceconfigvalidator.go
- datasourcetype.go
- datasourcewithconfigure.go
- datasourcewithconfigvalidators.go
- datasourcewithgetschema.go
- datasourcewithgetschema_temp.go
- datasourcewithmetadata.go
- datasourcewithvalidateconfig.go
- doc.go
- provider.go
- providerconfigvalidator.go
- providerwithconfigvalidators.go
- providerwithgetdatasources.go
- providerwithgetresources.go
- providerwithmeta.go
- providerwithmetadata.go
- providerwithvalidateconfig.go
- resource.go
- resourceconfigvalidator.go
- resourcetype.go
- resourcewithconfigure.go
- resourcewithconfigureandimportstate.go
- resourcewithconfigureandmodifyplan.go
- resourcewithconfigureandupgradestate.go
- resourcewithconfigvalidators.go
- resourcewithgetschema.go
- resourcewithgetschema_temp.go
- resourcewithimportstate.go
- resourcewithmetadata.go
- resourcewithmodifyplan.go
- resourcewithupgradestate.go
- resourcewithvalidateconfig.go