NOTES:
- State store support is considered experimental and offered without compatibility promises until support for
state_storein Terraform core is generally available. (#1259)
FEATURES:
- framework: Add support for deprecation messages on attributes and blocks in the configuration schema (#1276)
- statestore: New package for implementing state stores (#1259)
- statestore/schema: New package for implementing state store schemas (#1259)
ENHANCEMENTS:
- types/basetypes: Added
Length()method for theListValuetype. (#1067) - types/basetypes: Added
Length()method for theMapValuetype. (#1067) - types/basetypes: Added
Length()method for theSetValuetype. (#1067) - types/basetypes: Added
Length()method for theTupleValuetype. (#1067) - provider: Added
ProviderWithStateStoresinterface for implementing state stores (#1259) - provider: Added
StateStoreDatatoConfigureResponse, to pass provider-defined data to(statestore.StateStore).Initializemethods (#1262)
NOTES:
- In
terraform-plugin-framework@v1.15.1, theUseStateForUnknownplan modifier was updated to preserve null values from prior state for unconfigured attributes. This updated version can cause plan inconsistency errors when used on child attributes of a nested attribute that expectUseStateForUnknownto keep the child attributes on new nested objects as<unknown>(known after apply). The newUseNonNullStateForUnknownplan modifier can now be used where child attributes are expecting this pre-1.15.1 behavior. (#1197)
FEATURES:
- action/schema: Added
WriteOnlyschema field for action schemas. (#1233) - all: Added a new plan modifier for all types,
UseNonNullStateForUnknownthat preserves known, non-null, values for unconfigured attributes. This can be used when it is known that an unconfigured value will remain the same after the attribute is updated to a non-null value. (#1242)
BUG FIXES:
- fwserver: update validation list result validation to check if an identity's values are all null (#1230)
BUG FIXES:
- all: Prevent identity change validation from raising an error when prior identity is empty (all attributes are null) (#1229)
- all: Added an additional validation check to ensure the resource identity object is not null. (#1193)
NOTES:
- all: This Go module has been updated to Go 1.24 per the Go support policy. It is recommended to review the Go 1.24 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#1217)
- Support for the new
action{}block is in technical preview and offered without compatibility promises until Terraform 1.14 is generally available. (#1181) - action: This release contains a new interface (
action.Action) and packages for implementing action types, available in Terraform 1.14+. An action in Terraform can be defined by providers to model side-effects that practitioners can reference in their configurations via thelifecycle.action_triggerblock. (#1181) - List support is in technical preview and offered without compatibility promises until Terraform 1.14 is generally available. (#1150)
- list: This release contains a new interface (
list.ListResource) and packages for implementing list resource types, available in Terraform 1.14+. A list resource in Terraform can be defined by providers to list remote resources within a given scope. (#1150)
FEATURES:
- action: New package for implementing actions. (#1181)
- action/schema: New package for implementing action schemas. (#1183)
- types: Exported a previously internal function,
TerraformTypeToFrameworkType, which convertstftypes.Typeto a known framework type. (#1200) - list: New package for implementing list resources. (#1150)
- all: Update Framework to handle new ListResource RPCs. (#1157)
ENHANCEMENTS:
- provider: Added
ProviderWithActionsinterface for implementing actions. (#1181) - provider: Added
ActionDatatoConfigureResponse, to pass provider-defined data toaction.Actionimplementations. (#1185) - provider: Added
ListResourceDatatoConfigureResponse, to pass provider-defined data tolist.ListResourceimplementations. (#1202) - tfsdk: Allow
SetAtPathto be called with atftypes.Value. (#1198) - tfsdk: Allow
SetAttributeto be called with atftypes.Value. (#1205) - list: Add the
ListResourceWithRawV5SchemasandListResourceWithRawV6Schemasinterfaces to support list implementation on non-framework resources. (#1198)
FEATURES:
- actions: Initial package implementation and new Actions RPC support (#1181)
ENHANCEMENTS:
- list: add
limitfield toListResult(#1182) - list: add primitives, list and map types to schema (#1177)
- actions: add schema interface and unlinked schema (#1183)
- actions: add standard validation methods and interfaces for
ValidateActionConfigRPCs (#1188) - actions: add attributes and nested blocks to schema package (#1186)
BUG FIXES:
- list: call
ConfigureinListResourceRPC and remove theListResourcecall inValidateListResourceConfig(#1192)
NOTES:
- This alpha pre-release contains the initial implementation for list resource that returns a list of resource identities for a single managed resource type. (#1157)
- The ListResource and ValidateListResourceConfig RPCs are considered experimental and may change up until general availability (#1178)
BUG FIXES:
- all: Fixed bug with
UseStateForUnknownwhere known null state values were not preserved during update plans. (#1117)
NOTES:
- This release contains a change in behavior for the
UseStateForUnknownplan modifier, which will now preserve null values from prior state for unconfigured attributes. This updated version can cause plan inconsistency errors when used on child attributes of a nested attribute that expectUseStateForUnknownto keep the child attributes on new nested objects as<unknown>(known after apply). See #1197 for more details.
BUG FIXES:
- all: Fixed bug with
UseStateForUnknownwhere known null state values were not preserved during update plans. (#1117)
ATTENTION:
Please make sure to also update terraform-plugin-(go|mux|sdk|testing) when upgrading to this version. Otherwise there will be errors at runtime when using Terraform v1.12+ as this version of Plugin Framework supports the new resource identity feature and requires the supporting libraries to do so to.
Find #1148 for more information.
TL;DR – make sure to update to these versions (or higher)
github.com/hashicorp/terraform-plugin-go@v0.28.0
github.com/hashicorp/terraform-plugin-mux@v0.20.0
github.com/hashicorp/terraform-plugin-framework@v1.15.0
github.com/hashicorp/terraform-plugin-sdk/v2@v2.37.0
github.com/hashicorp/terraform-plugin-testing@v1.13.1
NOTES:
- all: This Go module has been updated to Go 1.23 per the Go support policy. It is recommended to review the Go 1.23 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#1114)
- all: This release contains a new interface and package for implmenting managed resource identity. Resource identity is data that is defined by a separate schema and is stored alongside resource state. Identity data is used by Terrform to uniquely identify a remote object and is meant to be immutable during the remote object's lifecycle. Resources that support identity can now be imported using the
identityattribute in Terraform configurationimportblocks, available in Terraform v1.12+. Theresource.ResourceWithIdentityinterface can be implemented to support identity by defining an identity schema. Once the identity schema is defined, you can read and store identity data in the state file via the newIdentityfields in the response objects on the resource CRUD methods. (#1112)
FEATURES:
- tfsdk: Added
ResourceIdentitystruct to represent managed resource identity data. (#1112) - resource/identityschema: New package for implementing managed resource identity schemas. (#1107)
- resource: Added new
ImportStatePassthroughWithIdentityhelper that can support both identity and ID importing via a single field. (#1134) - resource: Added
ResourceWithIdentityinterface for implementing managed resource identity. (#1107)
ENHANCEMENTS:
- resource: Updated
Create,Update,Read, andDeleterequest and response objects to support the passing of identity data. (#1112) - resource: Updated
ImportStatemethod to allow importing by resource identity and returning identity data from import response. (#1126)
NOTES:
- This beta pre-release continues the implementation of managed resource identity, which should now be used with Terraform v1.12.0-beta1. Managed resources now can support import by identity during plan and apply workflows. Managed resources that already support import via the
resource.ResourceWithImportStateinterface will automatically pass-through identity data to theReadmethod. TheRequiredForImportandOptionalForImportfields on the identity schema can be used to control the validation that Terraform core will apply to the import config block. (#1126)
NOTES:
- all: This Go module has been updated to Go 1.23 per the Go support policy. It is recommended to review the Go 1.23 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#1114)
- This alpha pre-release contains an initial implementation for managed resource identity, which can used with Terraform v1.12.0-alpha20250312, to store and read identity data during plan and apply workflows. A managed resource identity can be used by implementing the optional
resource.ResourceWithIdentityinterface and defining an identity schema. Once the identity schema is defined, you can read and store identity data in the state file via the newIdentityfields in the response objects on the resource CRUD methods. (#1112)
BUG FIXES:
- internal/fwserver: fixed bug where write-only attributes set in configuration would cause perpetual diffs for computed attributes. (#1097)
NOTES:
- Write-only attribute support is in technical preview and offered without compatibility promises until Terraform 1.11 is generally available. (#1044)
- ephemeral: Ephemeral resources are now considered generally available and protected by compatibility promises. (#1052)
FEATURES:
- resource/schema: Added
WriteOnlyschema field for managed resource schemas to indicate a write-only attribute. Write-only attribute values are not saved to the Terraform plan or state artifacts. (#1044)
BUG FIXES:
- internal/fwschemadata: Set semantic equality logic has been adjusted and will now ignore order of elements during comparison. (#1061)
- internal/fwserver: Fixed bug where dynamic attributes would not prompt invalid configuration error messages (#1090)
NOTES:
- Ephemeral resource support is in technical preview and offered without compatibility promises until Terraform 1.10 is generally available. (#1050)
FEATURES:
- ephemeral: New package for implementing ephemeral resources (#1050)
- ephemeral/schema: New package for implementing ephemeral resource schemas (#1050)
ENHANCEMENTS:
- provider: Added
ProviderWithEphemeralResourcesinterface for implementing ephemeral resources (#1050) - tfsdk: Added
EphemeralResultDatastruct for representing ephemeral values produced by a provider, such as from an ephemeral resource (#1050) - provider: Added
EphemeralResourceDatatoConfigureResponse, to pass provider-defined data toephemeral.EphemeralResourceimplementations (#1050)
NOTES:
- all: This Go module has been updated to Go 1.22 per the Go support policy. It is recommended to review the Go 1.22 release notes before upgrading. Any consumers building on earlier Go versions may experience errors (#1033)
BUG FIXES:
- providerserver: Fixed bug that prevented
movedoperation support between resource types for framework-only providers. (#1039)
NOTES:
- Framework reflection logic (
Config.Get,Plan.Get, etc.) for structs withtfsdkfield tags has been updated to support embedded structs that promote exported fields. For existing structs that embed unexported structs with exported fields, a tfsdk ignore tag (tfsdk:"-") can be added to ignore all promoted fields.
For example, the following struct will now return an error diagnostic:
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`
// Previously, this embedded struct was ignored, will now promote underlying fields
embeddedModel
}
type embeddedModel struct {
// No `tfsdk` tag
ExportedField string
}To preserve the original behavior, a tfsdk ignore tag can be added to ignore the entire embedded struct:
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`
// This embedded struct will now be ignored
embeddedModel `tfsdk:"-"`
}
type embeddedModel struct {
ExportedField string
}(#1021)
ENHANCEMENTS:
- all: Added embedded struct support for object to struct conversions with
tfsdktags (#1021)
FEATURES:
- types/basetypes: Added
Int32TypeandInt32Valueimplementations for Int32 value handling. (#1010) - types/basetypes: Added interfaces
basetypes.Int32Typable,basetypes.Int32Valuable, andbasetypes.Int32ValuableWithSemanticEqualsfor Int32 custom type and value implementations. (#1010) - resource/schema: Added
Int32Attributeimplementation for Int32 value handling. (#1010) - datasource/schema: Added
Int32Attributeimplementation for Int32 value handling. (#1010) - provider/schema: Added
Int32Attributeimplementation for Int32 value handling. (#1010) - function: Added
Int32ParameterandInt32Returnfor Int32 value handling. (#1010) - resource/schema/int32default: New package with
StaticValueimplementation for Int32 schema-based default values. (#1010) - resource/schema/int32planmodifier: New package with built-in implementations for Int32 value plan modification. (#1010)
- resource/schema/defaults: New
Int32interface for Int32 schema-based default implementations. (#1010) - resource/schema/planmodifier: New
Int32interface for Int32 value plan modification implementations. (#1010) - schema/validator: New
Int32interface for Int32 value schema validation. (#1010) - types/basetypes: Added
Float32TypeandFloat32Valueimplementations for Float32 value handling. (#1014) - types/basetypes: Added interfaces
basetypes.Float32Typable,basetypes.Float32Valuable, andbasetypes.Float32ValuableWithSemanticEqualsfor Float32 custom type and value implementations. (#1014) - resource/schema: Added
Float32Attributeimplementation for Float32 value handling. (#1014) - datasource/schema: Added
Float32Attributeimplementation for Float32 value handling. (#1014) - provider/schema: Added
Float32Attributeimplementation for Float32 value handling. (#1014) - function: Added
Float32ParameterandFloat32Returnfor Float32 value handling. (#1014) - resource/schema/float32default: New package with
StaticValueimplementation for Float32 schema-based default values. (#1014) - resource/schema/float32planmodifier: New package with built-in implementations for Float32 value plan modification. (#1014)
- resource/schema/defaults: New
Float32interface for Float32 schema-based default implementations. (#1014) - resource/schema/planmodifier: New
Float32interface for Float32 value plan modification implementations. (#1014) - schema/validator: New
Float32interface for Float32 value schema validation. (#1014)
NOTES:
- resource: If plan modification was dependent on nested attribute plan modification automatically running when the nested object was null/unknown, it may be necessary to add object-level plan modification to convert the nested object to a known object first. (#995)
- This release contains support for deferred actions, which is an experimental feature only available in prerelease builds of Terraform 1.9 and later. This functionality is subject to change and is not protected by version compatibility guarantees. (#999)
FEATURES:
- resource: Add
Deferredfield toReadResponse,ModifyPlanResponse, andImportStateResponsewhich indicates a resource deferred action to the Terraform client (#999) - datasource: Add
Deferredfield toReadResponsewhich indicates a data source deferred action to the Terraform client (#999) - resource: Add
ClientCapabilitiesfield toReadRequest,ModifyPlanRequest, andImportStateRequestwhich specifies optionally supported protocol features for the Terraform client (#999) - datasource: Add
ClientCapabilitiesfield toReadRequestwhich specifies optionally supported protocol features for the Terraform client (#999) - provider: Add
Deferredfield toConfigureResponsewhich indicates a provider deferred action to the Terraform client (#1002) - provider: Add
ClientCapabilitiesfield toConfigureRequestwhich specifies optionally supported protocol features for the Terraform client (#1002)
ENHANCEMENTS:
- function: Introduced implementation errors for collection and object parameters and returns which are missing type information (#991)
BUG FIXES:
- resource: Prevented errant collection-based nested object conversion from null/unknown object to known object (#995)
BREAKING CHANGES:
- function: Removed
DefinitiontypeParameter()method (#968)
NOTES:
- function: Provider-defined function features are now considered generally available and protected by compatibility promises (#966)
- attr/xattr: The
TypeWithValidateinterface has been deprecated in preference of theValidateableAttributeinterface. AValidatableParameterinterface has also been added to thefunctionpackage (#968)
FEATURES:
- attr/xattr: Added
ValidateableAttributeinterface for custom value type implementations (#968) - function: Added
ValidateableParameterinterface for custom value type implementations (#968) function: AddBoolParameterValidator,DynamicParameterValidator,Float64ParameterValidator,Int64ParameterValidator,ListParameterValidator,MapParameterValidator,NumberParameterValidator,ObjectParameterValidator,SetParameterValidator, andStringParameterValidatorinterfaces for custom function parameter validation implementations. (#971)function: AddParameterWithBoolValidators,ParameterWithInt64Validators,ParameterWithFloat64Validators,ParameterWithDynamicValidators,ParameterWithListValidators,ParameterWithMapValidators,ParameterWithNumberValidators,ParameterWithObjectValidators,ParameterWithSetValidators, andParameterWithStringValidatorsinterfaces to enable parameter-based validation support (#971)
BUG FIXES:
- types/basetypes: Prevented panic in the
MapValuetypesEqualmethod when the receiver has a nilelementType(#961) - types/basetypes: Prevented panic in the
ListValuetypesEqualmethod when the receiver has a nilelementType(#961) - types/basetypes: Prevented panic in the
SetValuetypesEqualmethod when the receiver has a nilelementType(#961) - resource: Ensured computed-only dynamic attributes will not cause
wrong final value typeerrors during planning (#969)
BREAKING CHANGES:
- function: All parameters must be explicitly named via the
Namefield (#964) - function:
DefaultParameterNamePrefixandDefaultVariadicParameterNameconstants have been removed (#964)
FEATURES:
- types/basetypes: Added
DynamicTypeandDynamicValueimplementations for dynamic value handling (#147) - types/basetypes: Added interfaces
basetypes.DynamicTypable,basetypes.DynamicValuable, andbasetypes.DynamicValuableWithSemanticEqualsfor dynamic custom type and value implementations (#147) - resource/schema: Added
DynamicAttributeimplementation for dynamic value handling (#147) - datasource/schema: Added
DynamicAttributeimplementation for dynamic value handling (#147) - provider/schema: Added
DynamicAttributeimplementation for dynamic value handling (#147) - function: Added
DynamicParameterandDynamicReturnfor dynamic value handling` (#147) - resource/schema/dynamicdefault: New package with
StaticValueimplementation for dynamic schema-based default values (#147) - resource/schema/dynamicplanmodifier: New package with built-in implementations for dynamic value plan modification. (#147)
- resource/schema/defaults: New
Dynamicinterface for dynamic schema-based default implementations (#147) - resource/schema/planmodifier: New
Dynamicinterface for dynamic value plan modification implementations (#147) - schema/validator: New
Dynamicinterface for dynamic value schema validation (#147)
NOTES:
- all: The
v1.6.0release updated this Go module to Go 1.21 per the Go support policy. It is recommended to review the Go 1.21 release notes before upgrading. Any consumers building on earlier Go versions may experience errors (#937)
BUG FIXES:
- resource/schema: Ensured invalid attribute default value errors are raised (#930)
- function: Added implementation validation to
function.Definitionto ensure all parameter names (including the variadic parameter) are unique. (#926) - function: Updated the default parameter name to include the position of the parameter (i.e.
param1,param2, etc.). Variadic parameters will default tovarparam. (#926)
BREAKING CHANGES:
- function: Changed the framework type for variadic parameters to
types.TupleType, where each element is the same element type. Provider-defined functions using atypes.Listfor retrieving variadic argument data will need to update their code to usetypes.Tuple. (#923) - function: Altered the
RunResponsetype, replacingDiagnosticswithFuncError(#925) - diag: Removed
DiagnosticWithFunctionArgumentinterface. RemovedNewArgumentErrorDiagnostic(),NewArgumentWarningDiagnostic()andWithFunctionArgument()functions. RemovedAddArgumentError()andAddArgumentWarning()methods fromDiagnostics. (#925)
FEATURES:
- resource: Added the
ResourceWithMoveStateinterface, which enables state moves across resource types with Terraform 1.8 and later (#917)
ENHANCEMENTS:
- privatestate: Added support for
SetKey()method to fully remove key withnilor zero-length value (#910) - function: Added
FuncErrortype, required forRunResponse(#925) - function: Added
NewFuncError()andNewArgumentFuncError()functions, which create aFuncError(#925) - function: Added
ConcatFuncErrors()andFuncErrorFromDiags()helper functions for use when working withFuncError(#925)
NOTES:
- all: Update
google.golang.org/grpcdependency to address CVE-2023-44487 (#865) - Provider-defined function support is in technical preview and offered without compatibility promises until Terraform 1.8 is generally available. (#889)
FEATURES:
- function: New package for implementing provider defined functions (#889)
ENHANCEMENTS:
- types/basetypes: Added
TupleTypeandTupleValueimplementations, which are only necessary for dynamic value handling (#870) - diag: Added
NewArgumentErrorDiagnostic()andNewArgumentWarningDiagnostic()functions, which create diagnostics with the function argument position set (#889) - provider: Added
ProviderWithFunctionsinterface for implementing provider defined functions (#889) - diag: Added
(Diagnostics).AddArgumentError()and(Diagnostics).AddArgumentWarning()methods for appending function argument diagnostics (#889)
BUG FIXES:
- resource: Add
Privatefield toDeleteResourcetype, which was missing to allow provider logic to update private state on errors (#863) - resource: Prevented private state data loss if resource destruction returned an error (#863)
BUG FIXES:
- providerserver: Prevented
Data Source Type Not FoundandResource Type Not Founderrors with Terraform 1.6 and later (#853)
NOTES:
- all: This Go module has been updated to Go 1.20 per the Go support policy. It is recommended to review the Go 1.20 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#835)
FEATURES:
- providerserver: Upgrade to protocol versions 5.4 and 6.4, which can significantly reduce memory usage with Terraform 1.6 and later when a configuration includes multiple instances of the same provider (#828)
NOTES:
- internal: Changed provider defined method execution logs from
DEBUGlog level toTRACE(#818)
BUG FIXES:
- internal/fwserver: Prevented
Invalid Element Typediagnostics for nested attributes and blocks implementingCustomTypefield (#823)
BUG FIXES:
- types/basetypes: Prevented Float64Value Terraform data consistency errors for numbers with high precision floating point rounding errors (#817)
BUG FIXES:
- types/basetypes: Minor reduction of memory allocations for
ObjectValuetypeToTerraformValue()method, which decreases provider operation durations at scale (#775) - resource: Prevented panic during planning caused by
SetNestedAttributewith nested attributeDefaultand multiple configured elements (#783) - tfsdk: Prevented
Value Conversion Errordiagnostics when usingSet()method with base types instead of custom types (#806) - providerserver: Significantly reduced memory usage for framework data handling operations, especially during the
PlanResourceChangeRPC (#792)
BUG FIXES:
- resource/schema: Ensured
Defaultimplementations received requestPathand have responseDiagnosticshandled (#778) - resource/schema: Prevented panics with
Defaultimplementations on list, map, and set where no responseDiagnosticsorPlanValuewas returned (#778) - providerserver: Ensured Terraform CLI interrupts (e.g. Ctrl-c) properly cancel the
context.Contextof inflight requests (#782) - providerserver: Prevented caching of unused data and managed resource schemas (#784)
BUG FIXES:
- datasource/schema: Ensure nested attribute and block Equal methods check nested attribute and block definition equality (#752)
- provider/metaschema: Ensure nested attribute Equal methods check nested attribute definition equality (#752)
- provider/schema: Ensure nested attribute and block Equal methods check nested attribute and block definition equality (#752)
- resource/schema: Ensure nested attribute and block Equal methods check nested attribute and block definition equality (#752)
- types/basetypes: Prevented panics in
ListType,MapType, andSetTypemethods whenElemTypefield is not set (#714) - resource/schema: Prevented
Value Conversion Errordiagnostics for attributes and blocks implementing bothCustomTypeandPlanModifiersfields (#754) - types/basetypes: Prevented panic with
ListTypableWithSemanticEqualsandSetTypableWithSemanticEqualswhen proposed new element count was greater than prior element count (#772)
NOTES:
- datasource/schema: The
SchematypeValidate()method has been deprecated in preference ofValidateImplementation()(#699) - provider/metaschema: The
SchematypeValidate()method has been deprecated in preference ofValidateImplementation()(#699) - provider/schema: The
SchematypeValidate()method has been deprecated in preference ofValidateImplementation()(#699) - resource/schema: The
SchematypeValidate()method has been deprecated in preference ofValidateImplementation()(#699)
ENHANCEMENTS:
- datasource/schema: Added
SchematypeValidateImplementation()method, which performs framework-defined schema validation and can be used in unit testing (#699) - provider/metaschema: Added
SchematypeValidateImplementation()method, which performs framework-defined schema validation and can be used in unit testing (#699) - provider/schema: Added
SchematypeValidateImplementation()method, which performs framework-defined schema validation and can be used in unit testing (#699) - resource/schema: Added
SchematypeValidateImplementation()method, which performs framework-defined schema validation and can be used in unit testing (#699) - datasource/schema: Raise validation errors if attempting to use top-level
for_eachattribute name, which requires special Terraform configuration syntax to be usable by the data source (#704) - resource/schema: Raise validation errors if attempting to use top-level
for_eachattribute name, which requires special Terraform configuration syntax to be usable by the resource (#704) - datasource/schema: Raise validation errors if attempting to use attribute names with leading numerics (0-9), which are invalid in the Terraform configuration language (#705)
- provider/schema: Raise validation errors if attempting to use attribute names with leading numerics (0-9), which are invalid in the Terraform configuration language (#705)
- resource/schema: Raise validation errors if attempting to use attribute names with leading numerics (0-9), which are invalid in the Terraform configuration language (#705)
- all: Improved SDK logging performance when messages would be skipped due to configured logging level (#744)
BUG FIXES:
- datasource/schema: Raise errors with
ListAttribute,MapAttribute,ObjectAttribute, andSetAttributeimplementations instead of panics when missing requiredAttributeTypesorElementTypesfields (#699) - provider/metaschema: Raise errors with
ListAttribute,MapAttribute,ObjectAttribute, andSetAttributeimplementations instead of panics when missing requiredAttributeTypesorElementTypesfields (#699) - provider/schema: Raise errors with
ListAttribute,MapAttribute,ObjectAttribute, andSetAttributeimplementations instead of panics when missing requiredAttributeTypesorElementTypesfields (#699) - resource/schema: Raise errors with
ListAttribute,MapAttribute,ObjectAttribute, andSetAttributeimplementations instead of panics when missing requiredAttributeTypesorElementTypesfields (#699) - tfsdk: Raise framework errors instead of generic upstream errors or panics when encountering unexpected values with
Set()methods (#715)
NOTES:
- New
DEBUGlevelDetected value change between proposed new state and prior statelog messages with the offending attribute path are now emitted when proposed new state value differences would cause the framework to automatically mark all unconfiguredComputedattributes as unknown during planning. These can be used to troubleshoot potential resource implementation issues, or framework and Terraform plan logic bugs. (#630) - This Go module has been updated to Go 1.19 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#682)
FEATURES:
- resource/schema: Introduce packages, interface types, and built-in static value functionality for schema-based default values (#674)
ENHANCEMENTS:
- internal/fwserver: Added
DEBUGlogging to aid troubleshooting unexpected plans with unknown values (#630) - types/basetypes: Add
BoolValuetypeNewBoolPointerValue()creation function andValueBoolPointer()method (#689) - types/basetypes: Add
Float64ValuetypeNewFloat64PointerValue()creation function andValueFloat64Pointer()method (#689) - types/basetypes: Add
Int64ValuetypeNewInt64PointerValue()creation function andValueInt64Pointer()method (#689) - types/basetypes: Add
StringValuetypeNewStringPointerValue()creation function andValueStringPointer()method (#689) - resource/schema: Added
Defaultfields toAttributetypes, which support schema-based default values (#674)
BUG FIXES:
- types/basetypes: Fixed
Float64TypetypeValueFromTerraformmethod to handle valid, stringified numbers from Terraform (#648) - resource: Prevented nested attribute and block plan modifications from being undone (#669)
BUG FIXES:
- all: Prevented
tftypes.NewValue can't use []tftypes.Value as a tftypes.Objectpanics with schemas that includedSingleNestedBlock(#624)
NOTES:
- all: For data handling consistency with attributes, unconfigured list and set blocks will now be represented as a null list or set instead of a known list or set with zero elements. This prevents confusing situations with validation and plan modification, where it was previously required to check block values for the number of elements. Logic that was previously missing null value checks for blocks may require updates. (#604)
- tfsdk: The
Config,Plan, andStatetypePathMatches()method logic previously returnedInvalid Path Expression for Schema Dataerrors based on implementation details of the underlying data, which prevented returning zero matches in cases where the expression is valid for the schema, but there was no actual data at the path. Providers can now determine whether zero matches is consequential for their use case. (#602)
ENHANCEMENTS:
- path: Added
ExpressionstypeMatchesmethod for checking if any expression in the collection matches a given path (#604) - tfsdk: Automatically prevented Terraform
nested blocks must be empty to indicate no blockserrors for responses containingPlanandStatetypes (#621)
BUG FIXES:
- datasource/schema: Prevented
ListNestedBlockandSetNestedBlocktypeDeprecationMessagefield from causingBlock Deprecatedwarnings with unconfigured blocks (#604) - datasource: Prevented
ConfigValidatorsfrom unexpectedly modifying or removing prior validator diagnostics (#619) - provider/schema: Prevented
ListNestedBlockandSetNestedBlocktypeDeprecationMessagefield from causingBlock Deprecatedwarnings with unconfigured blocks (#604) - provider: Prevented
ConfigValidatorsfrom unexpectedly modifying or removing prior validator diagnostics (#619) - resource/schema: Prevented
ListNestedBlockandSetNestedBlocktypeDeprecationMessagefield from causingBlock Deprecatedwarnings with unconfigured blocks (#604) - resource: Prevented
ConfigValidatorsfrom unexpectedly modifying or removing prior validator diagnostics (#619) - tfsdk: Fixed false positive
Invalid Path Expression for Schema Dataerror to be schema-determined instead of data-determined (#602) - types/basetypes: Fixed
ObjectTypetypeApplyTerraform5AttributePathStepmethod to return an error instead ofnilfor invalid attribute name steps (#602)
BUG FIXES:
- resource/schema/planmodifier: Prevented
assignment to entry in nil mappanic forObjecttype plan modifiers (#591) - types/basetypes: Prevented type mutation via the
ObjectTypetypeAttributeTypes()method return (#591) - types/basetypes: Prevented value mutation via the
ListValue,MapValue, andSetValuetypeElements()method return (#591) - types/basetypes: Prevented value mutation via the
ObjectValuetypeAttributeTypes()andAttributes()method returns (#591)
NOTES:
- The Terraform Plugin Framework is now generally available with semantic versioning compatibility promises. (#578)
- types: Framework type implementations have been moved into the underlying
basetypespackage. Value creation functions and type aliases have been created in thetypespackage that should prevent any breaking changes. (#567)
BREAKING CHANGES:
- provider: The
Providerinterface now requires theMetadatamethod. It can be left empty or set theMetadataResponsetypeTypeNamefield to populatedatasource.MetadataRequestandresource.MetadataRequesttypeProviderTypeNamefields. (#580) - resource: The
RequiresReplace()plan modifier has been removed. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.RequiresReplace()orresource/schema/stringplanmodifier.RequiresReplaceIfConfigured()(#576) - resource: The
RequiresReplaceIf()plan modifier has been removed. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.RequiresReplaceIf()(#576) - resource: The
ResourcetypeGetSchemamethod has been removed. Use theSchemamethod instead. (#576) - resource: The
StateUpgradertypePriorSchemafield type has been migrated fromtfsdk.Schematoresource/schema.Schema, similar to other resource schema handling (#573) - resource: The
UseStateForUnknown()plan modifier has been removed. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.UseStateForUnknown()(#576) - tfsdk: The
AttributePlanModifierinterface has been removed. Use the type-specific plan modifier interfaces in theresource/schema/planmodifierpackage instead. (#576) - tfsdk: The
AttributeValidatorinterface has been removed. Use the type-specific validator interfaces in theschema/validatorpackage instead. (#576) - tfsdk: The
Attribute,Block, andSchematypes have been removed. Use the similarly named types in thedatasource/schema,provider/schema, andresource/schemapackages instead. (#576) - tfsdk: The
ListNestedAttributes,MapNestedAttributes,SetNestedAttributes, andSingleNestedAttributesfunctions have been removed. Use the similarly named types in thedatasource/schema,provider/schema, andresource/schemapackages instead. (#576) - types: The type-specific
TypableandValuableinterfaces have been moved into the underlyingbasetypespackage. (#567)
FEATURES:
- types/basetypes: New package which contains embeddable types for custom types (#567)
BUG FIXES:
- datasource: Add
Validatefunction toSchemato prevent usage of reserved and invalid names for attributes and blocks (#548) - provider: Add
Validatefunction toMetaSchemato prevent usage of reserved and invalid names for attributes and blocks (#548) - provider: Add
Validatefunction toSchemato prevent usage of reserved and invalid names for attributes and blocks (#548) - resource: Add
Validatefunction toSchemato prevent usage of reserved and invalid names for attributes and blocks (#548)
NOTES:
- datasource: The
DataSourcetypeGetSchemamethod has been deprecated. Use theSchemamethod instead. (#546) - provider: The
ProvidertypeGetSchemamethod has been deprecated. Use theSchemamethod instead. (#553) - resource: The
RequiresReplace()plan modifier has been deprecated. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.RequiresReplace()orresource/schema/stringplanmodifier.RequiresReplaceIfConfigured()(#565) - resource: The
RequiresReplaceIf()plan modifier has been deprecated. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.RequiresReplaceIf()(#565) - resource: The
ResourcetypeGetSchemamethod has been deprecated. Use theSchemamethod instead. (#558) - resource: The
UseStateForUnknown()plan modifier has been deprecated. Use a type-specific plan modifier instead, such asresource/schema/stringplanmodifier.UseStateForUnknown()(#565) - tfsdk: The
Attribute,Block, andSchematypes have been deprecated. Use the similarly named types in thedatasource/schema,provider/schema, andresource/schemapackages instead. (#563) - tfsdk: The
ListNestedAttributes,MapNestedAttributes,SetNestedAttributes, andSingleNestedAttributesfunctions have been deprecated. Use the similarly named types in thedatasource/schema,provider/schema, andresource/schemapackages instead. (#563)
BREAKING CHANGES:
- provider: The
ProviderWithMetaSchematypeGetMetaSchemamethod has been replaced with theMetaSchemamethod (#562) - tfsdk: The
AttributetypeFrameworkType()method has been removed. Use theGetType()method instead which returns the same information. (#543) - tfsdk: The
AttributetypeGetType()method now returns type information whether the attribute implements theTypefield orAttributesfield. (#543) - tfsdk: The
Config,Plan, andStatetypeSchemafield type has been updated fromtfsdk.Schemato the genericfwschema.Schemainterface to enable additional schema implementations (#544)
FEATURES:
- datasource/schema: New package which contains schema interfaces and types relevant to data sources (#546)
- provider/schema: New package which contains schema interfaces and types relevant to providers (#553)
- resource/schema/planmodifier: New package which contains type-specific schema plan modifier interfaces (#557)
- resource/schema: New package which contains schema interfaces and types relevant to resources (#558)
- resource/schema: New packages, such as
stringplanmodifierwhich contain type-specific schema plan modifier implementations (#565) - schema/validator: New package which contains type-specific schema validator interfaces (#542)
BUG FIXES:
- diag: Allow diagnostic messages with incorrect UTF-8 encoding to pass through with the invalid sequences replaced with the Unicode Replacement Character. This avoids returning the unhelpful message "string field contains invalid UTF-8" in that case. (#549)
- internal/fwserver: Ensured blocks are ignored when marking computed nils as unknown during resource change planning (#552)
BREAKING CHANGES:
- types: The
BooltypeNull,Unknown, andValuefields have been removed. Use theBoolNull(),BoolUnknown(), andBoolValue()creation functions andIsNull(),IsUnknown(), andValueBool()methods instead. (#523) - types: The
Float64typeNull,Unknown, andValuefields have been removed. Use theFloat64Null(),Float64Unknown(), andFloat64Value()creation functions andIsNull(),IsUnknown(), andValueFloat64()methods instead. (#523) - types: The
Int64typeNull,Unknown, andValuefields have been removed. Use theInt64Null(),Int64Unknown(), andInt64Value()creation functions andIsNull(),IsUnknown(), andValueInt64()methods instead. (#523) - types: The
ListtypeElems,ElemType,Null, andUnknownfields have been removed. Use theListNull(),ListUnknown(),ListValue(), andListValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods instead. (#523) - types: The
MaptypeElems,ElemType,Null, andUnknownfields have been removed. Use theMapNull(),MapUnknown(),MapValue(), andMapValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods instead. (#523) - types: The
NumbertypeNull,Unknown, andValuefields have been removed. Use theNumberNull(),NumberUnknown(), andNumberValue()creation functions andIsNull(),IsUnknown(), andValueBigFloat()methods instead. (#523) - types: The
ObjecttypeAttrs,AttrTypes,Null, andUnknownfields have been removed. Use theObjectNull(),ObjectUnknown(),ObjectValue(), andObjectValueMust()creation functions andAs(),Attributes(),AttributeTypes(),IsNull(), andIsUnknown()methods instead. (#523) - types: The
SettypeElems,ElemType,Null, andUnknownfields have been removed. Use theSetNull(),SetUnknown(),SetValue(), andSetValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods instead. (#523) - types: The
StringtypeNull,Unknown, andValuefields have been removed. Use theStringNull(),StringUnknown(), andStringValue()creation functions andIsNull(),IsUnknown(), andValueString()methods instead. (#523)
ENHANCEMENTS:
- attr: Added
ValueStatetype, which custom types can use to consistently represent the three possible value states (known, null, and unknown) (#523) - types: Added
BoolTypableandBoolValuableinterface types, which enable embedding existing boolean types for custom types (#536) - types: Added
Float64TypableandFloat64Valuableinterface types, which enable embedding existing float64 types for custom types (#536) - types: Added
Int64TypableandInt64Valuableinterface types, which enable embedding existing int64 types for custom types (#536) - types: Added
ListTypableandListValuableinterface types, which enable embedding existing list types for custom types (#536) - types: Added
MapTypableandMapValuableinterface types, which enable embedding existing map types for custom types (#536) - types: Added
NumberTypableandNumberValuableinterface types, which enable embedding existing number types for custom types (#536) - types: Added
ObjectTypableandObjectValuableinterface types, which enable embedding existing object types for custom types (#536) - types: Added
SetTypableandSetValuableinterface types, which enable embedding existing set types for custom types (#536) - types: Added
StringTypableandStringValuableinterface types, which enable embedding existing string types for custom types (#536)
BUG FIXES:
- types: Prevented Terraform errors where the zero-value for any
attr.Valuetypes such asStringwould be a known value instead of null (#523) - types: Prevented indeterminate behavior for any
attr.Valuetypes where they could be any combination of null, unknown, and/or known (#523)
NOTES:
- types: The
BooltypeNull,Unknown, andValuefields have been deprecated in preference of theBoolNull(),BoolUnknown(), andBoolValue()creation functions andIsNull(),IsUnknown(), andValueBool()methods. The fields will be removed in a future release. (#502) - types: The
Float64typeNull,Unknown, andValuefields have been deprecated in preference of theFloat64Null(),Float64Unknown(), andFloat64Value()creation functions andIsNull(),IsUnknown(), andValueFloat64()methods. The fields will be removed in a future release. (#502) - types: The
Int64typeNull,Unknown, andValuefields have been deprecated in preference of theInt64Null(),Int64Unknown(), andInt64Value()creation functions andIsNull(),IsUnknown(), andValueInt64()methods. The fields will be removed in a future release. (#502) - types: The
ListtypeElems,ElemType,Null, andUnknownfields have been deprecated in preference of theListNull(),ListUnknown(),ListValue(), andListValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods. The fields will be removed in a future release. (#502) - types: The
MaptypeElems,ElemType,Null, andUnknownfields have been deprecated in preference of theMapNull(),MapUnknown(),MapValue(), andMapValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods. The fields will be removed in a future release. (#502) - types: The
NumbertypeNull,Unknown, andValuefields have been deprecated in preference of theNumberNull(),NumberUnknown(), andNumberValue()creation functions andIsNull(),IsUnknown(), andValueBigFloat()methods. The fields will be removed in a future release. (#502) - types: The
ObjecttypeAttrs,AttrTypes,Null, andUnknownfields have been deprecated in preference of theObjectNull(),ObjectUnknown(),ObjectValue(), andObjectValueMust()creation functions andAs(),Attributes(),AttributeTypes(),IsNull(), andIsUnknown()methods. The fields will be removed in a future release. (#502) - types: The
SettypeElems,ElemType,Null, andUnknownfields have been deprecated in preference of theSetNull(),SetUnknown(),SetValue(), andSetValueMust()creation functions andElements(),ElementsAs(),ElementType(),IsNull(), andIsUnknown()methods. The fields will be removed in a future release. (#502) - types: The
StringtypeNull,Unknown, andValuefields have been deprecated in preference of theStringNull(),StringUnknown(), andStringValue()creation functions andIsNull(),IsUnknown(), andValueString()methods. The fields will be removed in a future release. (#502)
ENHANCEMENTS:
- types: Added
BoolNull(),BoolUnknown(), andBoolValue()functions, which create immutableBoolvalues (#502) - types: Added
BooltypeValueBool()method, which returns theboolof the known value orfalseif null or unknown (#502) - types: Added
Float64Null(),Float64Unknown(), andFloat64Value()functions, which create immutableFloat64values (#502) - types: Added
Float64typeValueFloat64()method, which returns thefloat64of the known value or0.0if null or unknown (#502) - types: Added
Int64Null(),Int64Unknown(), andInt64Value()functions, which create immutableInt64values (#502) - types: Added
Int64typeValueInt64()method, which returns theint64of the known value or0if null or unknown (#502) - types: Added
ListNull(),ListUnknown(),ListValue(), andListValueMust()functions, which create immutableListvalues (#502) - types: Added
ListValueFrom(),MapValueFrom(),ObjectValueFrom(), andSetValueFrom()functions, which can create value types from standard Go types using reflection similar totfsdk.ValueFrom()(#522) - types: Added
ListtypeElements()method, which returns the[]attr.Valueof the known values ornilif null or unknown (#502) - types: Added
MapNull(),MapUnknown(),MapValue(), andMapValueMust()functions, which create immutableMapvalues (#502) - types: Added
MaptypeElements()method, which returns themap[string]attr.Valueof the known values ornilif null or unknown (#502) - types: Added
NumberNull(),NumberUnknown(), andNumberValue()functions, which create immutableNumbervalues (#502) - types: Added
NumbertypeValueBigFloat()method, which returns the*big.Floatof the known value ornilif null or unknown (#502) - types: Added
SetNull(),SetUnknown(),SetValue(), andSetValueMust()functions, which create immutableSetvalues (#502) - types: Added
SettypeElements()method, which returns the[]attr.Valueof the known values ornilif null or unknown (#502) - types: Added
StringNull(),StringUnknown(), andStringValue()functions, which create immutableStringvalues (#502) - types: Added
StringtypeValueString()method, which returns thestringof the known value or""if null or unknown (#502)
NOTES:
- The Terraform Plugin Framework is now in beta. Feedback towards a general availability release in the future with compatibility promises is appreciated. (#500)
BREAKING CHANGES:
- attr: The
Typeinterface now requires theValueTypemethod, which is used for enhancing error diagnostics from the framework (#497)
ENHANCEMENTS:
- internal/reflect: Added
attr.Valuetype suggestions to error diagnostics (#497)
NOTES:
- tfsdk: Schema definitions may now introduce single nested mode blocks, however this support is only intended for migrating terraform-plugin-sdk timeouts blocks. New implementations should prefer single nested attributes instead. (#477)
BREAKING CHANGES:
- datasource: The
DataSourceinterface now requires theGetSchemaandMetadatamethods. (#478) - provider: The
DataSourceTypeandResourceTypetypes have been removed. Use theGetSchema,Metadata, and optionally theConfiguremethods ondatasource.DataSourceandresource.Resourceimplementations instead. (#478) - provider: The
ProviderinterfaceGetDataSourcesandGetResourcesmethods have been removed. Use theDataSourcesandResourcesmethods instead. (#478) - resource: The
Resourceinterface now requires theGetSchemaandMetadatamethods. (#478)
ENHANCEMENTS:
- tfsdk: Added single nested mode block support (#477)
BUG FIXES:
- internal/fwserver: Ensured nested block plan modifiers correctly set their request
AttributeConfig,AttributePlan, andAttributeStatevalues (#479) - types: Ensured
List,Map, andSettypes withxattr.TypeWithValidateelements run validation on those elements (#481)
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:
- internal/fwserver: Delayed deprecated attribute/block warnings for unknown values, which may be null (#465)
- internal/fwserver: Fixed alignment of set type plan modification (#468)
BUG FIXES:
- resource: Prevented
Error Decoding Private Stateerrors on resources previously managed by terraform-plugin-sdk (#452)
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:
- internal/fwserver: Ensured
UpgradeResourceStatecalls from Terraform 0.12 properly ignored attributes not defined in the schema (#426) - path: Ensured
ExpressiontypeCopy()method appropriately copied root expressions andEqual()checked for root versus relative expressions (#420)
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)
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)
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)
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)
BUG FIXES:
- types: Prevented panics with missing type information during
Float64,Int64, andSetvalidation logic (#259)
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:
- tfsdk: Removed
Schemarestriction that it must contain at least one attribute or block (#252) - tfsdk: Support protocol version 5 and verify valid resource type in
UpgradeResourceStateRPC (#263)
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)
BUG FIXES:
- Fix bug in which updating
Computed-only attributes would lead to a "Provider produced inconsistent result after apply" error (#176/#184)
NOTES:
- Upgraded to terraform-plugin-go v0.4.0 which contains its own breaking changes. Please see https://github.com/hashicorp/terraform-plugin-go/blob/main/CHANGELOG.md#040-september-24-2021 for more details. (#179)
BREAKING CHANGES:
attr.Typeimplementations must now have aString()method that returns a human-friendly name for the type. (#120)- tfsdk:
Resourceimplementations must now include theImportState(context.Context, ImportResourceStateRequest, *ImportResourceStateResponse)method. If import is not supported, call theResourceImportStateNotImplemented()function or return an error. (#149)
FEATURES:
- tfsdk: Support resource import (#149)
- types: Support
SetandSetType(#126) - types: Support for
Float64,Float64Type,Int64, andInt64Type(#166)
ENHANCEMENTS:
- Added a
tfsdk.ConvertValuehelper that will convert anyattr.Valueinto any compatibleattr.Type. Compatibility happens at the terraform-plugin-go level; the type that theattr.Value'sToTerraformValuemethod produces must be compatible with theattr.Type'sTerraformType(). Generally, this means that theattr.Typeof theattr.Valueand theattr.Typebeing converted to must both produce the sametftypes.Typewhen theirTerraformType()method is called. (#120)
BUG FIXES:
- attr: Ensure
Listtypes implementingattr.TypeWithValidatecallElementTypevalidation only if that type implementsattr.TypeWithValidate(#126) - tfsdk:
(Plan).SetAttribute()and(State).SetAttribute()will now create missing attribute paths instead of silently failing to update. (#165)
BREAKING CHANGES:
- Methods on the
tfsdk.Config,tfsdk.Plan, andtfsdk.Statetypes now return[]*tfprotov6.Diagnosticinstead oferror(#82) - Most uses of
[]*tfprotov6.Diagnostichave been replaced with a newdiag.Diagnosticstype. Please update your type signatures, and use one of thediags.New*helper functions instead of constructing*tfprotov6.Diagnostics by hand. (#110) - The
schema.Attributeandschema.Schematypes have been moved totfsdk.Attributeandtfsdk.Schema. No changes beyond import names are required. (#77) - With the release of Go 1.17, Go 1.17 is now the lowest supported version of Go to use with terraform-plugin-framework. (#104)
attr.Valueimplementations must now implement aType(context.Context)method that returns theattr.Typethat created theattr.Value. (#119)
FEATURES:
- Added support for ModifyPlan functions on Resources. (#90)
- Introduced first-class diagnostics (
diagpackage). (#110) - Support
attr.Typevalidation (#82) - tfsdk: Attributes, Data Sources, Providers, and Resources now support configuration validation (#75)
ENHANCEMENTS:
- Added a
tfsdk.ValueAshelper that allows accessing anattr.Valuewithout type assertion, by using the same reflection rules used in theConfig.Get,Plan.Get, andState.Gethelpers. (#119) - Errors from methods on the
tfsdk.Config,tfsdk.Plan, andtfsdk.Statetypes now include rich diagnostic information (#82) - tfsdk: Validate
Attributedefines at least one ofRequired,Optional, orComputed(#111)
BUG FIXES:
- tfsdk: Diagnostics returned from
(Plan).SetAttribute()and(State).SetAttribute()reflection will now properly include attribute path (#133) - tfsdk: Don't attempt validation on the nested attributes of a null or unknown
SingleNestedAttribute(#118) - tfsdk: Return warning diagnostic when using
AttributeorSchematypeDeprecationMessagefield (#93)
ENHANCEMENTS:
- Added
tfsdk.NewProtocol6Serverto return atfprotov6.ProviderServerimplementation for testing and muxing purposes. (#72) - Added support for MapNestedAttributes. (#79)
- Responses now default to returning the current state, meaning state will only change when provider developers actively change it. Previously, an empty state value would be returned, which caused problems. (#74)
FEATURES:
- Added interfaces extending the attr.Type interface to include attribute and element types. (#44)
- Added state, config, and plan types, and support for getting values from them. (#46)
- Added support for Object types. (#38)
- Added support for bools, numbers, and strings. (#29)
- Added support for defining schemas and attributes. (#27)
- Added support for lists. (#36)
- Added support for maps. (#37)
- Added support for provider, resource, and data source types. (#32)
- Added the ability to serve providers. (#45)