Releases: hashicorp/terraform-plugin-framework
Releases · hashicorp/terraform-plugin-framework
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
Schema
typeAttributeAtPath()
method signature will be updated from a*tftypes.AttributePath
parameter topath.Path
in the next release. Switch to theAttributeAtTerraformPath()
method if*tftypes.AttributePath
handling is still necessary. (#440) - tfsdk: The
Schema
typeAttributeType()
method has been deprecated in preference of theType()
method. (#440) - tfsdk: The
Schema
typeAttributeTypeAtPath()
method has been deprecated for theTypeAtPath()
andTypeAtTerraformPath()
methods. (#440) - tfsdk: The
Schema
typeTerraformType()
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
datasource
package. 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
provider
package. 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
resource
package. 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 theresource
package. (#434) - tfsdk: The
ResourceImportStatePassthroughID()
function has been moved toresource.ImportStatePassthroughID()
. (#432) - tfsdk: The
Schema
typeAttributeAtPath
method now returns afwschema.Attribute
interface instead of atfsdk.Attribute
type. 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
tfsdk
package (#432) - provider: New package, which colocates all provider implementation types from the
tfsdk
package (#432) - resource: Enabled provider developers to read/write private state data. (#433)
- resource: New package, which colocates all resource implementation types from the
tfsdk
package (#432)
ENHANCEMENTS:
- tfsdk: Added
Block
typeMaxItems
andMinItems
field validation for Terraform 0.12 through 0.15.1 (#422)
BUG FIXES:
v0.10.0
BREAKING CHANGES:
- attr: The
TypeWithValidate
interface has been moved under theattr/xattr
package and the*tftypes.AttributePath
parameter is replaced withpath.Path
(#390) - diag: The
DiagnosticWithPath
interfacePath
method*tftypes.AttributePath
return is replaced withpath.Path
(#390) - diag: The
Diagnostics
typeAddAttributeError
andAddAttributeWarning
method*tftypes.AttributePath
parameters are replaced withpath.Path
(#390) - diag: The
NewAttributeErrorDiagnostic
andNewAttributeWarningDiagnostic
function*tftypes.AttributePath
parameters are replaced withpath.Path
(#390) - tfsdk: The
Config
,Plan
, andState
typesGetAttribute
andSetAttribute
methods*tftypes.AttributePath
parameters are replaced withpath.Path
(#390) - tfsdk: The
DataSourceConfigValidator
interfaceValidate
method is nowValidateDataSource
to support generic validators that satisfyDataSourceConfigValidator
,ProviderConfigValidator
, andResourceConfigValidator
(#405) - tfsdk: The
ModifyAttributePlanRequest
,ModifyResourcePlanResponse
, andValidateAttributeRequest
typeAttributePath *tftypes.AttributePath
fields are replaced withAttributePath path.Path
(#390) - tfsdk: The
PlanResourceChange
RPC 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
ProviderConfigValidator
interfaceValidate
method is nowValidateProvider
to support generic validators that satisfyDataSourceConfigValidator
,ProviderConfigValidator
, andResourceConfigValidator
(#405) - tfsdk: The
RequiresReplaceIf
andResourceImportStatePassthroughID
function*tftypes.AttributePath
parameters are replaced withpath.Path
(#390) - tfsdk: The
ResourceConfigValidator
interfaceValidate
method is nowValidateResource
to 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
Diagnostics
typeEqual()
method (#402) - diag:
ErrorsCount
,WarningsCount
,Errors
andWarnings
functions have been added todiag.Diagnostics
(#392) - providerserver: Added sdk.proto logger request duration and response diagnostics logging (#398)
- tfsdk: Added
AttributePathExpression
field toModifyAttributePlanRequest
andValidateAttributeRequest
types (#396) - tfsdk: Added
PathMatches
method toConfig
,Plan
, andState
types (#396) - tfsdk: Added framework-specific error diagnostics when
Resource
implementations errantly return no errors and empty state afterCreate
andUpdate
methods (#406) - types: Method
IsNull()
forNumber
type will now return true if the struct is zero-value initialized. (#384)
v0.9.0
BREAKING CHANGES:
- attr: The
Value
interface now includes theIsNull()
andIsUnknown()
methods (#335) - attr: The
Value
interface now includes theString()
method (#376) - tfsdk:
ListNestedAttributes
,SetNestedAttributes
andMapNestedAttributes
functions 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
ServeOpts
typeProtocolVersion
field, which can be set to5
or6
and defaults to6
(#368) - tfsdk: New function
ValueFrom
that takes a Go value and populates a compatibleattr.Value
, given a descriptiveattr.Type
. (#350) - tfsdk: Removed
ListNestedAttributesOptions
,SetNestedAttributesOptions
andMapNestedAttributesOptions
types, 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
Schema
containedBlocks
(#371) - types: Prevented panic being thrown when
.ToTerraformValue
is called on anattr.Value
type whereElemType / AttrsType
were not set. (#354) - types: Prevented potential loss of number precision with
Int64
between 54 and 64 bits (#325)
v0.8.0
BREAKING CHANGES:
- diag: Removed
Diagnostics
typeToTfprotov6Diagnostics()
method. This was not intended for usage by provider developers. (#313) - tfsdk: The
ModifySchemaPlanRequest
,ModifySchemaPlanResponse
,ValidateSchemaRequest
, andValidateSchemaResponse
types have been removed. These were not intended for provider developer usage. (#310) - tfsdk: The
NewProtocol6Server()
function,Serve()
function, andServeOpts
type have been removed. Use theproviderserver
package instead. (#310) - tfsdk: The
ResourceImportStateNotImplemented()
function has been removed. Remove theResource
typeImportState
method instead for resources that should not support import. (#312)
ENHANCEMENTS:
- tfsdk: Propagated
tf_data_source_type
,tf_req_id
,tf_resource_type
, andtf_rpc
fields 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 options
warning logs during acceptance testing (#315)
v0.7.0
NOTES:
- tfsdk: Providers may now optionally remove
RemoveResource()
calls fromResource
typeDelete
methods (#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, theImportState
method can be removed from theResource
and the framework will automatically return an error diagnostic if import is attempted. (#297) - tfsdk: The
Resource
interface no longer requires theImportState
method. A separateResourceWithImportState
interface now defines the sameImportState
method. (#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
ServeOpts
type has been deprecated in preference of theproviderserver.ServeOpts
type. When migrating, theName
field has been replaced withAddress
. Thetfsdk.ServeOpts
type will be removed in the next minor version. (#308) - tfsdk: The previously unexported
server
type has been temporarily exported to aid in the migration to the newproviderserver
package. It is not intended for provider developer usage and will be moved into an internal package in the next minor version. (#308)
FEATURES:
- Introduced
providerserver
package, which contains all functions and types necessary for serving a provider in production or acceptance testing. (#308) - tfsdk: Added optional
ResourceWithUpgradeState
interface, which allows for provider defined logic when theUpgradeResourceState
RPC is called (#292)
ENHANCEMENTS:
- tfsdk: Added
DEBUG
level logging for all framework handoffs to provider defined logic (#300) - tfsdk: Added
ResourceWithImportState
interface, which allowsResource
implementations to optionally define theImportState
method. (#297) - tfsdk: Added automatic
(DeleteResourceResponse.State).RemoveResource()
call afterResource
typeDelete
method execution if there are no errors (#301)
v0.6.1
v0.6.0
NOTES:
- The underlying
terraform-plugin-log
dependency 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
ToTerraformValue
method of theattr.Value
interface now returns atftypes.Value
, instead of aninterface{}
. Existing types need to be updated to calltftypes.ValidateValue
andtftypes.NewValue
, passing the value they were returning before, instead of returning the value directly. (#231) - tfsdk: The
ListNestedAttributesOptions
,MapNestedAttributeOptions
, andSetNestedAttributeOptions
typeMaxItems
andMinItems
fields 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.Value
when 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
Debug
field toServeOpts
for 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
AttributeErrorDiagnostic
andAttributeWarningDiagnostic
types have been removed. Any usage can be replaced withDiagnosticWithPath
. (#219) - tfsdk: The
AddAttributeError
,AddAttributeWarning
,AddError
, andAddWarning
methods on theConfigureProviderResponse
,CreateResourceResponse
,DeleteResourceResponse
,ModifyAttributePlanResponse
,ModifyResourcePlanResponse
,ReadDataSourceResponse
,ReadResourceResponse
, andUpdateResourceResponse
types have been removed in preference of the same methods on theDiagnostics
field of these types. For example, code such asresp.AddError("...", "...")
can be updated toresp.Diagnostics.AddError("...", "...")
. (#198) - tfsdk: The
Config
,Plan
, andState
typeGetAttribute
methods now return diagnostics only and require the target as the last parameter, similar to theGet
method. (#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
, andState
typeGetAttribute
methods can now be used to fetch values directly intoattr.Value
implementations and Go types. (#167)
BUG FIXES:
- tfsdk: Fetch null values from valid missing
Config
,Plan
, andState
paths inGetAttribute()
method (#185) - types: Ensure
Float64
Type()
method returnsFloat64Type
(#202) - types: Prevent panic with uninitialized
Number
Value
(#200) - types: Prevent panics when
ValueFromTerraform
receivednil
values (#208)