Documentation
¶
Overview ¶
Package proto6server contains the provider server implementation compatible with protocol version 6 (tfprotov6.ProviderServer).
Index ¶
- func AttributeModifyPlan(ctx context.Context, a tfsdk.Attribute, req tfsdk.ModifyAttributePlanRequest, ...)
- func AttributeValidate(ctx context.Context, a tfsdk.Attribute, req tfsdk.ValidateAttributeRequest, ...)
- func AttributeValidateNestedAttributes(ctx context.Context, a tfsdk.Attribute, req tfsdk.ValidateAttributeRequest, ...)
- func BlockModifyPlan(ctx context.Context, b tfsdk.Block, req tfsdk.ModifyAttributePlanRequest, ...)
- func BlockValidate(ctx context.Context, b tfsdk.Block, req tfsdk.ValidateAttributeRequest, ...)
- func ConfigGetAttributeValue(ctx context.Context, c tfsdk.Config, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
- func ConfigTerraformValueAtPath(c tfsdk.Config, path *tftypes.AttributePath) (tftypes.Value, error)
- func PlanGetAttributeValue(ctx context.Context, p tfsdk.Plan, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
- func PlanTerraformValueAtPath(p tfsdk.Plan, path *tftypes.AttributePath) (tftypes.Value, error)
- func SchemaBlockAtPath(s tfsdk.Schema, path *tftypes.AttributePath) (tfsdk.Block, error)
- func SchemaModifyPlan(ctx context.Context, s tfsdk.Schema, req ModifySchemaPlanRequest, ...)
- func SchemaValidate(ctx context.Context, s tfsdk.Schema, req ValidateSchemaRequest, ...)
- func StateGetAttributeValue(ctx context.Context, s tfsdk.State, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
- func StateTerraformValueAtPath(s tfsdk.State, path *tftypes.AttributePath) (tftypes.Value, error)
- type ModifySchemaPlanRequest
- type ModifySchemaPlanResponse
- type Server
- func (s *Server) ApplyResourceChange(ctx context.Context, req *tfprotov6.ApplyResourceChangeRequest) (*tfprotov6.ApplyResourceChangeResponse, error)
- func (s *Server) ConfigureProvider(ctx context.Context, req *tfprotov6.ConfigureProviderRequest) (*tfprotov6.ConfigureProviderResponse, error)
- func (s *Server) GetProviderSchema(ctx context.Context, req *tfprotov6.GetProviderSchemaRequest) (*tfprotov6.GetProviderSchemaResponse, error)
- func (s *Server) ImportResourceState(ctx context.Context, req *tfprotov6.ImportResourceStateRequest) (*tfprotov6.ImportResourceStateResponse, error)
- func (s *Server) PlanResourceChange(ctx context.Context, req *tfprotov6.PlanResourceChangeRequest) (*tfprotov6.PlanResourceChangeResponse, error)
- func (s *Server) ReadDataSource(ctx context.Context, req *tfprotov6.ReadDataSourceRequest) (*tfprotov6.ReadDataSourceResponse, error)
- func (s *Server) ReadResource(ctx context.Context, req *tfprotov6.ReadResourceRequest) (*tfprotov6.ReadResourceResponse, error)
- func (s *Server) StopProvider(ctx context.Context, _ *tfprotov6.StopProviderRequest) (*tfprotov6.StopProviderResponse, error)
- func (s *Server) UpgradeResourceState(ctx context.Context, req *tfprotov6.UpgradeResourceStateRequest) (*tfprotov6.UpgradeResourceStateResponse, error)
- func (s *Server) ValidateDataResourceConfig(ctx context.Context, req *tfprotov6.ValidateDataResourceConfigRequest) (*tfprotov6.ValidateDataResourceConfigResponse, error)
- func (s *Server) ValidateProviderConfig(ctx context.Context, req *tfprotov6.ValidateProviderConfigRequest) (*tfprotov6.ValidateProviderConfigResponse, error)
- func (s *Server) ValidateResourceConfig(ctx context.Context, req *tfprotov6.ValidateResourceConfigRequest) (*tfprotov6.ValidateResourceConfigResponse, error)
- type ValidateSchemaRequest
- type ValidateSchemaResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributeModifyPlan ¶
func AttributeModifyPlan(ctx context.Context, a tfsdk.Attribute, req tfsdk.ModifyAttributePlanRequest, resp *ModifySchemaPlanResponse)
AttributeModifyPlan runs all AttributePlanModifiers
TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func AttributeValidate ¶
func AttributeValidate(ctx context.Context, a tfsdk.Attribute, req tfsdk.ValidateAttributeRequest, resp *tfsdk.ValidateAttributeResponse)
AttributeValidate performs all Attribute validation.
TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func AttributeValidateNestedAttributes ¶
func AttributeValidateNestedAttributes(ctx context.Context, a tfsdk.Attribute, req tfsdk.ValidateAttributeRequest, resp *tfsdk.ValidateAttributeResponse)
AttributeValidateNestedAttributes performs all nested Attributes validation.
TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func BlockModifyPlan ¶
func BlockModifyPlan(ctx context.Context, b tfsdk.Block, req tfsdk.ModifyAttributePlanRequest, resp *ModifySchemaPlanResponse)
BlockModifyPlan performs all Block plan modification.
TODO: Clean up this abstraction back into an internal Block type method. The extra Block parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func BlockValidate ¶
func BlockValidate(ctx context.Context, b tfsdk.Block, req tfsdk.ValidateAttributeRequest, resp *tfsdk.ValidateAttributeResponse)
BlockValidate performs all Block validation.
TODO: Clean up this abstraction back into an internal Block type method. The extra Block parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func ConfigGetAttributeValue ¶
func ConfigGetAttributeValue(ctx context.Context, c tfsdk.Config, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
ConfigGetAttributeValue is a duplicate of tfsdk.Config.getAttributeValue, except it calls a local duplicate to Config.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.Config.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.
TODO: Clean up this abstraction back into an internal Config type method. The extra Config parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func ConfigTerraformValueAtPath ¶
ConfigTerraformValueAtPath is a duplicate of tfsdk.Config.terraformValueAtPath.
TODO: Clean up this abstraction back into an internal Config type method. The extra Config parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func PlanGetAttributeValue ¶
func PlanGetAttributeValue(ctx context.Context, p tfsdk.Plan, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
PlanGetAttributeValue is a duplicate of tfsdk.Plan.getAttributeValue, except it calls a local duplicate to Plan.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.Plan.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.
TODO: Clean up this abstraction back into an internal Plan type method. The extra Plan parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func PlanTerraformValueAtPath ¶
PlanTerraformValueAtPath is a duplicate of tfsdk.Plan.terraformValueAtPath.
TODO: Clean up this abstraction back into an internal Plan type method. The extra Plan parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func SchemaBlockAtPath ¶
SchemaBlockAtPath returns the Block at the passed path. If the path points to an element or attribute of a complex type, rather than to a Block, it will return an ErrPathInsideAtomicAttribute error.
TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func SchemaModifyPlan ¶
func SchemaModifyPlan(ctx context.Context, s tfsdk.Schema, req ModifySchemaPlanRequest, resp *ModifySchemaPlanResponse)
SchemaModifyPlan runs all AttributePlanModifiers in all schema attributes and blocks.
TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func SchemaValidate ¶
func SchemaValidate(ctx context.Context, s tfsdk.Schema, req ValidateSchemaRequest, resp *ValidateSchemaResponse)
SchemaValidate performs all Attribute and Block validation.
TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func StateGetAttributeValue ¶
func StateGetAttributeValue(ctx context.Context, s tfsdk.State, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)
StateGetAttributeValue is a duplicate of tfsdk.State.getAttributeValue, except it calls a local duplicate to State.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.State.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.
TODO: Clean up this abstraction back into an internal State type method. The extra State parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
func StateTerraformValueAtPath ¶
StateTerraformValueAtPath is a duplicate of tfsdk.State.terraformValueAtPath.
TODO: Clean up this abstraction back into an internal State type method. The extra State parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215
Types ¶
type ModifySchemaPlanRequest ¶
type ModifySchemaPlanRequest struct { // Config is the configuration the user supplied for the resource. Config tfsdk.Config // State is the current state of the resource. State tfsdk.State // Plan is the planned new state for the resource. Plan tfsdk.Plan // ProviderMeta is metadata from the provider_meta block of the module. ProviderMeta tfsdk.Config }
ModifySchemaPlanRequest represents a request for a schema to run all attribute plan modification functions.
type ModifySchemaPlanResponse ¶
type ModifySchemaPlanResponse struct { // Plan is the planned new state for the resource. Plan tfsdk.Plan // RequiresReplace is a list of tftypes.AttributePaths that require the // resource to be replaced. They should point to the specific field // that changed that requires the resource to be destroyed and // recreated. RequiresReplace []*tftypes.AttributePath // Diagnostics report errors or warnings related to running all attribute // plan modifiers. Returning an empty slice indicates a successful // plan modification with no warnings or errors generated. Diagnostics diag.Diagnostics }
ModifySchemaPlanResponse represents a response to a ModifySchemaPlanRequest.
type Server ¶
type Server struct { FrameworkServer fwserver.Server // Provider will be migrated to FrameworkServer over time. Provider tfsdk.Provider // contains filtered or unexported fields }
Provider server implementation.
func (*Server) ApplyResourceChange ¶
func (s *Server) ApplyResourceChange(ctx context.Context, req *tfprotov6.ApplyResourceChangeRequest) (*tfprotov6.ApplyResourceChangeResponse, error)
func (*Server) ConfigureProvider ¶
func (s *Server) ConfigureProvider(ctx context.Context, req *tfprotov6.ConfigureProviderRequest) (*tfprotov6.ConfigureProviderResponse, error)
func (*Server) GetProviderSchema ¶
func (s *Server) GetProviderSchema(ctx context.Context, req *tfprotov6.GetProviderSchemaRequest) (*tfprotov6.GetProviderSchemaResponse, error)
func (*Server) ImportResourceState ¶
func (s *Server) ImportResourceState(ctx context.Context, req *tfprotov6.ImportResourceStateRequest) (*tfprotov6.ImportResourceStateResponse, error)
ImportResourceState satisfies the tfprotov6.ProviderServer interface.
func (*Server) PlanResourceChange ¶
func (s *Server) PlanResourceChange(ctx context.Context, req *tfprotov6.PlanResourceChangeRequest) (*tfprotov6.PlanResourceChangeResponse, error)
func (*Server) ReadDataSource ¶
func (s *Server) ReadDataSource(ctx context.Context, req *tfprotov6.ReadDataSourceRequest) (*tfprotov6.ReadDataSourceResponse, error)
func (*Server) ReadResource ¶
func (s *Server) ReadResource(ctx context.Context, req *tfprotov6.ReadResourceRequest) (*tfprotov6.ReadResourceResponse, error)
func (*Server) StopProvider ¶
func (s *Server) StopProvider(ctx context.Context, _ *tfprotov6.StopProviderRequest) (*tfprotov6.StopProviderResponse, error)
func (*Server) UpgradeResourceState ¶
func (s *Server) UpgradeResourceState(ctx context.Context, req *tfprotov6.UpgradeResourceStateRequest) (*tfprotov6.UpgradeResourceStateResponse, error)
func (*Server) ValidateDataResourceConfig ¶
func (s *Server) ValidateDataResourceConfig(ctx context.Context, req *tfprotov6.ValidateDataResourceConfigRequest) (*tfprotov6.ValidateDataResourceConfigResponse, error)
func (*Server) ValidateProviderConfig ¶
func (s *Server) ValidateProviderConfig(ctx context.Context, req *tfprotov6.ValidateProviderConfigRequest) (*tfprotov6.ValidateProviderConfigResponse, error)
func (*Server) ValidateResourceConfig ¶
func (s *Server) ValidateResourceConfig(ctx context.Context, req *tfprotov6.ValidateResourceConfigRequest) (*tfprotov6.ValidateResourceConfigResponse, error)
type ValidateSchemaRequest ¶
type ValidateSchemaRequest struct { // Config contains the entire configuration of the data source, provider, or resource. // // This configuration may contain unknown values if a user uses // interpolation or other functionality that would prevent Terraform // from knowing the value at request time. Config tfsdk.Config }
ValidateSchemaRequest repesents a request for validating a Schema.
type ValidateSchemaResponse ¶
type ValidateSchemaResponse struct { // Diagnostics report errors or warnings related to validating the schema. // An empty slice indicates success, with no warnings or errors generated. Diagnostics diag.Diagnostics }
ValidateSchemaResponse represents a response to a ValidateSchemaRequest.