Releases: hashicorp/terraform-plugin-framework
Releases · hashicorp/terraform-plugin-framework
v0.12.0
NOTES:
- datasource: The
DataSourcetypeGetSchemaandMetadatamethods will be required in the next version. (#472) - provider: The
DataSourceTypetype has been deprecated in preference of moving theGetSchemamethod to thedatasource.DataSourcetype and optionally implementing theNewResourcemethod logic to a newConfiguremethod. TheDataSourceTypetype will be removed in the next version. (#472) - provider: The
ProvidertypeGetDataSourcesmethod has been deprecated in preference of theDataSourcesmethod. Alldatasource.DataSourcetypes must implement theMetadatamethod after migrating. Support for theGetDataSourcesmethod will be removed in the next version. (#472) - provider: The
ProvidertypeGetResourcesmethod has been deprecated in preference of theResourcesmethod. Allresource.Resourcetypes must implement theMetadatamethod after migrating. Support for theGetResourcesmethod will be removed in the next version. (#472) - provider: The
ResourceTypetype has been deprecated in preference of moving theGetSchemamethod to theresource.Resourcetype and optionally implementing theNewResourcemethod logic to a newConfiguremethod. TheResourceTypetype will be removed in the next version. (#472) - resource: The
ResourcetypeGetSchemaandMetadatamethods will be required in the next version. (#472)
BREAKING CHANGES:
- tfsdk: The
SchematypeAttributeAtPath()method signature has be updated with apath.Pathparameter anddiag.Diagnosticsreturn. Use theAttributeAtTerraformPath()method instead if*tftypes.AttributePathor specificerrorhandling is still necessary. (#450) - tfsdk: The previously deprecated
SchematypeAttributeType()method has been removed. Use theType()method instead. (#450) - tfsdk: The previously deprecated
SchematypeAttributeTypeAtPath()method has been removed. Use theTypeAtPath()orTypeAtTerraformPath()method instead. (#450) - tfsdk: The previously deprecated
SchematypeTerraformType()method has been removed. UseType().TerraformType()instead. (#450)
ENHANCEMENTS:
- datasource: Added
DataSourcetypeConfigure,GetSchema, andMetadatamethod support (#472) - provider: Added
ConfigureResponsetypeDataSourceDatafield, which will set thedatasource.ConfigureRequest.ProviderDatafield (#472) - provider: Added
ConfigureResponsetypeResourceDatafield, which will set theresource.ConfigureRequest.ProviderDatafield (#472) - provider: Added
ProvidertypeMetadatamethod support, which theMetadataResponse.TypeNamefield will set thedatasource.MetadataRequest.ProviderTypeNameandresource.MetadataRequest.ProviderTypeNamefields (#472) - resource: Added
ResourcetypeConfigure,GetSchema, andMetadatamethod support (#472)
BUG FIXES:
v0.11.1
v0.11.0
NOTES:
- This Go module has been updated to Go 1.18 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#445)
- tfsdk: The
SchematypeAttributeAtPath()method signature will be updated from a*tftypes.AttributePathparameter topath.Pathin the next release. Switch to theAttributeAtTerraformPath()method if*tftypes.AttributePathhandling is still necessary. (#440) - tfsdk: The
SchematypeAttributeType()method has been deprecated in preference of theType()method. (#440) - tfsdk: The
SchematypeAttributeTypeAtPath()method has been deprecated for theTypeAtPath()andTypeAtTerraformPath()methods. (#440) - tfsdk: The
SchematypeTerraformType()method has been deprecated in preference of callingType().TerraformType(). (#440)
BREAKING CHANGES:
- tfsdk: Go types relating to data source handling have been migrated to the new
datasourcepackage. Consult the pull request description for a full listing of find-and-replace information. (#432) - tfsdk: Go types relating to provider handling have been migrated to the new
providerpackage. Consult the pull request description for a full listing of find-and-replace information. (#432) - tfsdk: Go types relating to resource handling have been migrated to the new
resourcepackage. Consult the pull request description for a full listing of find-and-replace information. (#432) - tfsdk: The
RequiresReplace(),RequiresReplaceIf(), andUseStateForUnknown()plan modifier functions, which only apply to managed resources, have been moved to theresourcepackage. (#434) - tfsdk: The
ResourceImportStatePassthroughID()function has been moved toresource.ImportStatePassthroughID(). (#432) - tfsdk: The
SchematypeAttributeAtPathmethod now returns afwschema.Attributeinterface instead of atfsdk.Attributetype. Consumers will need to update from direct field usage to similarly named interface method calls. (#438)
FEATURES:
- datasource: New package, which colocates all data source implementation types from the
tfsdkpackage (#432) - provider: New package, which colocates all provider implementation types from the
tfsdkpackage (#432) - resource: Enabled provider developers to read/write private state data. (#433)
- resource: New package, which colocates all resource implementation types from the
tfsdkpackage (#432)
ENHANCEMENTS:
- tfsdk: Added
BlocktypeMaxItemsandMinItemsfield validation for Terraform 0.12 through 0.15.1 (#422)
BUG FIXES:
v0.10.0
BREAKING CHANGES:
- attr: The
TypeWithValidateinterface has been moved under theattr/xattrpackage and the*tftypes.AttributePathparameter is replaced withpath.Path(#390) - diag: The
DiagnosticWithPathinterfacePathmethod*tftypes.AttributePathreturn is replaced withpath.Path(#390) - diag: The
DiagnosticstypeAddAttributeErrorandAddAttributeWarningmethod*tftypes.AttributePathparameters are replaced withpath.Path(#390) - diag: The
NewAttributeErrorDiagnosticandNewAttributeWarningDiagnosticfunction*tftypes.AttributePathparameters are replaced withpath.Path(#390) - tfsdk: The
Config,Plan, andStatetypesGetAttributeandSetAttributemethods*tftypes.AttributePathparameters are replaced withpath.Path(#390) - tfsdk: The
DataSourceConfigValidatorinterfaceValidatemethod is nowValidateDataSourceto support generic validators that satisfyDataSourceConfigValidator,ProviderConfigValidator, andResourceConfigValidator(#405) - tfsdk: The
ModifyAttributePlanRequest,ModifyResourcePlanResponse, andValidateAttributeRequesttypeAttributePath *tftypes.AttributePathfields are replaced withAttributePath path.Path(#390) - tfsdk: The
PlanResourceChangeRPC on destroy is now enabled. To prevent unexpected Terraform errors, the framework attempts to catch errant provider logic in plan modifiers when destroying. Resource level plan modifiers may require updates to handle a completely null proposed new state (plan) and ensure it remains completely null on resource destruction. (#409) - tfsdk: The
ProviderConfigValidatorinterfaceValidatemethod is nowValidateProviderto support generic validators that satisfyDataSourceConfigValidator,ProviderConfigValidator, andResourceConfigValidator(#405) - tfsdk: The
RequiresReplaceIfandResourceImportStatePassthroughIDfunction*tftypes.AttributePathparameters are replaced withpath.Path(#390) - tfsdk: The
ResourceConfigValidatorinterfaceValidatemethod is nowValidateResourceto support generic validators that satisfyDataSourceConfigValidator,ProviderConfigValidator, andResourceConfigValidator(#405)
FEATURES:
- Support plan modifiers returning warning and error diagnostics on resource destruction with Terraform 1.3 and later (#409)
- path: Introduced attribute path expressions (#396)
- path: Introduced framework abstraction for attribute path handling (#390)
ENHANCEMENTS:
- diag: Added
DiagnosticstypeEqual()method (#402) - diag:
ErrorsCount,WarningsCount,ErrorsandWarningsfunctions have been added todiag.Diagnostics(#392) - providerserver: Added sdk.proto logger request duration and response diagnostics logging (#398)
- tfsdk: Added
AttributePathExpressionfield toModifyAttributePlanRequestandValidateAttributeRequesttypes (#396) - tfsdk: Added
PathMatchesmethod toConfig,Plan, andStatetypes (#396) - tfsdk: Added framework-specific error diagnostics when
Resourceimplementations errantly return no errors and empty state afterCreateandUpdatemethods (#406) - types: Method
IsNull()forNumbertype will now return true if the struct is zero-value initialized. (#384)
v0.9.0
BREAKING CHANGES:
- attr: The
Valueinterface now includes theIsNull()andIsUnknown()methods (#335) - attr: The
Valueinterface now includes theString()method (#376) - tfsdk:
ListNestedAttributes,SetNestedAttributesandMapNestedAttributesfunctions lost the second argumentopts, as it was unused. (#349)
FEATURES:
- providerserver: Implemented native protocol version 5 support (#368)
ENHANCEMENTS:
- providerserver: Added
NewProtocol5()andNewProtocol5WithError()functions, which return a protocol version 5 compatible provider server (#368) - providerserver: Added
ServeOptstypeProtocolVersionfield, which can be set to5or6and defaults to6(#368) - tfsdk: New function
ValueFromthat takes a Go value and populates a compatibleattr.Value, given a descriptiveattr.Type. (#350) - tfsdk: Removed
ListNestedAttributesOptions,SetNestedAttributesOptionsandMapNestedAttributesOptionstypes, as they were empty (no fields) and unused. (#349) - types: Added
IsNull()andIsUnknown()methods to all types (#335) - types: Added
String()method to all types (#376)
BUG FIXES:
- tfsdk: Prevented configuration handling error when
SchemacontainedBlocks(#371) - types: Prevented panic being thrown when
.ToTerraformValueis called on anattr.Valuetype whereElemType / AttrsTypewere not set. (#354) - types: Prevented potential loss of number precision with
Int64between 54 and 64 bits (#325)
v0.8.0
BREAKING CHANGES:
- diag: Removed
DiagnosticstypeToTfprotov6Diagnostics()method. This was not intended for usage by provider developers. (#313) - tfsdk: The
ModifySchemaPlanRequest,ModifySchemaPlanResponse,ValidateSchemaRequest, andValidateSchemaResponsetypes have been removed. These were not intended for provider developer usage. (#310) - tfsdk: The
NewProtocol6Server()function,Serve()function, andServeOptstype have been removed. Use theproviderserverpackage instead. (#310) - tfsdk: The
ResourceImportStateNotImplemented()function has been removed. Remove theResourcetypeImportStatemethod instead for resources that should not support import. (#312)
ENHANCEMENTS:
- tfsdk: Propagated
tf_data_source_type,tf_req_id,tf_resource_type, andtf_rpcfields in log entries (#315)
BUG FIXES:
- all: Prevented
This log was generated by an SDK subsystem logger that wasn't created before being used.warning messages in logging (#314) - tfsdk: Prevented
Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger optionswarning logs during acceptance testing (#315)
v0.7.0
NOTES:
- tfsdk: Providers may now optionally remove
RemoveResource()calls fromResourcetypeDeletemethods (#301) - tfsdk: The
NewProtocol6Server()function has been deprecated in preference ofproviderserver.NewProtocol6()andproviderserver.NewProtocol6WithError()functions, which will simplify muxing and testing implementations. Thetfsdk.NewProtocol6Server()function will be removed in the next minor version. (#308) - tfsdk: The
ResourceImportStateNotImplemented()function has been deprecated. Instead, theImportStatemethod can be removed from theResourceand the framework will automatically return an error diagnostic if import is attempted. (#297) - tfsdk: The
Resourceinterface no longer requires theImportStatemethod. A separateResourceWithImportStateinterface now defines the sameImportStatemethod. (#297) - tfsdk: The
Serve()function has been deprecated in preference of theproviderserver.Serve()function. Thetfsdk.Serve()function will be removed in the next minor version. (#308) - tfsdk: The
ServeOptstype has been deprecated in preference of theproviderserver.ServeOptstype. When migrating, theNamefield has been replaced withAddress. Thetfsdk.ServeOptstype will be removed in the next minor version. (#308) - tfsdk: The previously unexported
servertype has been temporarily exported to aid in the migration to the newproviderserverpackage. It is not intended for provider developer usage and will be moved into an internal package in the next minor version. (#308)
FEATURES:
- Introduced
providerserverpackage, which contains all functions and types necessary for serving a provider in production or acceptance testing. (#308) - tfsdk: Added optional
ResourceWithUpgradeStateinterface, which allows for provider defined logic when theUpgradeResourceStateRPC is called (#292)
ENHANCEMENTS:
- tfsdk: Added
DEBUGlevel logging for all framework handoffs to provider defined logic (#300) - tfsdk: Added
ResourceWithImportStateinterface, which allowsResourceimplementations to optionally define theImportStatemethod. (#297) - tfsdk: Added automatic
(DeleteResourceResponse.State).RemoveResource()call afterResourcetypeDeletemethod execution if there are no errors (#301)
v0.6.1
v0.6.0
NOTES:
- The underlying
terraform-plugin-logdependency has been updated to v0.3.0, which includes a breaking change in the optional additional fields parameter of logging function calls to ensure correctness and catch coding errors during compilation. Any early adopter provider logging which calls those functions may require updates. (#268)
BREAKING CHANGES:
- The
ToTerraformValuemethod of theattr.Valueinterface now returns atftypes.Value, instead of aninterface{}. Existing types need to be updated to calltftypes.ValidateValueandtftypes.NewValue, passing the value they were returning before, instead of returning the value directly. (#231) - tfsdk: The
ListNestedAttributesOptions,MapNestedAttributeOptions, andSetNestedAttributeOptionstypeMaxItemsandMinItemsfields have been removed since the protocol and framework never supported this type of nested attribute validation. Use attribute validators instead. (#249)
ENHANCEMENTS:
- Added the ability to get an attribute as a generic
attr.Valuewhen usingGetAttribute. (#232) - Logging can now be used by calling
tflog.Trace,tflog.Debug,tflog.Info,tflog.Warn, ortflog.Error. See the tflog docs for more information. (#234) - tfsdk: Added
Debugfield toServeOptsfor running providers via debugger and testing processes (#243)
BUG FIXES:
v0.5.0
BREAKING CHANGES:
- Fixed RequiresReplace and RequiresReplaceIf to be more judicious about when they require a resource to be destroyed and recreated. They will no longer require resources to be recreated when any attribute changes, instead limiting it only to the attribute they're declared on. They will also not require resources to be recreated when they're being created or deleted. Finally, they won't require a resource to be recreated if the user has no value in the config for the attribute and the attribute is computed; this is to prevent the resource from being destroyed and recreated when the provider changes the value without any user prompting. Providers that wish to destroy and recreate the resource when an optional and computed attribute is removed from the user's config should do so in their own plan modifier. (#213)
- RequiresReplaceIf no longer overrides previous plan modifiers' value for RequiresReplace if the function returns false. (#213)
- diag: The
AttributeErrorDiagnosticandAttributeWarningDiagnostictypes have been removed. Any usage can be replaced withDiagnosticWithPath. (#219) - tfsdk: The
AddAttributeError,AddAttributeWarning,AddError, andAddWarningmethods on theConfigureProviderResponse,CreateResourceResponse,DeleteResourceResponse,ModifyAttributePlanResponse,ModifyResourcePlanResponse,ReadDataSourceResponse,ReadResourceResponse, andUpdateResourceResponsetypes have been removed in preference of the same methods on theDiagnosticsfield of these types. For example, code such asresp.AddError("...", "...")can be updated toresp.Diagnostics.AddError("...", "..."). (#198) - tfsdk: The
Config,Plan, andStatetypeGetAttributemethods now return diagnostics only and require the target as the last parameter, similar to theGetmethod. (#167)
FEATURES:
- Added
tfsdk.UseStateForUnknown()as a built-in plan modifier, which will automatically replace an unknown value in the plan with the value from the state. This mimics the behavior of computed and optional+computed values in Terraform Plugin SDK versions 1 and 2. Provider developers will likely want to use it for "write-once" attributes that never change once they're set in state. (#204) - tfsdk: Support list and set blocks in schema definitions (#188)
ENHANCEMENTS:
- diag: Added
WithPath()function to wrap or overwrite diagnostic path information. (#219) - tfsdk: The
Config,Plan, andStatetypeGetAttributemethods can now be used to fetch values directly intoattr.Valueimplementations and Go types. (#167)
BUG FIXES:
- tfsdk: Fetch null values from valid missing
Config,Plan, andStatepaths inGetAttribute()method (#185) - types: Ensure
Float64Type()method returnsFloat64Type(#202) - types: Prevent panic with uninitialized
NumberValue(#200) - types: Prevent panics when
ValueFromTerraformreceivednilvalues (#208)