Skip to content

Releases: hashicorp/terraform-plugin-framework

v1.3.2

28 Jun 17:31
Compare
Choose a tag to compare

BUG FIXES:

  • resource/schema: Ensured Default implementations received request Path and have response Diagnostics handled (#778)
  • resource/schema: Prevented panics with Default implementations on list, map, and set where no response Diagnostics or PlanValue was returned (#778)
  • providerserver: Ensured Terraform CLI interrupts (e.g. Ctrl-c) properly cancel the context.Context of inflight requests (#782)
  • providerserver: Prevented caching of unused data and managed resource schemas (#784)

v1.3.1

14 Jun 18:49
Compare
Choose a tag to compare

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, and SetType methods when ElemType field is not set (#714)
  • resource/schema: Prevented Value Conversion Error diagnostics for attributes and blocks implementing both CustomType and PlanModifiers fields (#754)
  • types/basetypes: Prevented panic with ListTypableWithSemanticEquals and SetTypableWithSemanticEquals when proposed new element count was greater than prior element count (#772)

v1.3.0

07 Jun 14:10
Compare
Choose a tag to compare

NOTES:

  • datasource/schema: The Schema type Validate() method has been deprecated in preference of ValidateImplementation() (#699)
  • provider/metaschema: The Schema type Validate() method has been deprecated in preference of ValidateImplementation() (#699)
  • provider/schema: The Schema type Validate() method has been deprecated in preference of ValidateImplementation() (#699)
  • resource/schema: The Schema type Validate() method has been deprecated in preference of ValidateImplementation() (#699)

ENHANCEMENTS:

  • datasource/schema: Added Schema type ValidateImplementation() method, which performs framework-defined schema validation and can be used in unit testing (#699)
  • provider/metaschema: Added Schema type ValidateImplementation() method, which performs framework-defined schema validation and can be used in unit testing (#699)
  • provider/schema: Added Schema type ValidateImplementation() method, which performs framework-defined schema validation and can be used in unit testing (#699)
  • resource/schema: Added Schema type ValidateImplementation() 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_each attribute 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_each attribute 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, and SetAttribute implementations instead of panics when missing required AttributeTypes or ElementTypes fields (#699)
  • provider/metaschema: Raise errors with ListAttribute, MapAttribute, ObjectAttribute, and SetAttribute implementations instead of panics when missing required AttributeTypes or ElementTypes fields (#699)
  • provider/schema: Raise errors with ListAttribute, MapAttribute, ObjectAttribute, and SetAttribute implementations instead of panics when missing required AttributeTypes or ElementTypes fields (#699)
  • resource/schema: Raise errors with ListAttribute, MapAttribute, ObjectAttribute, and SetAttribute implementations instead of panics when missing required AttributeTypes or ElementTypes fields (#699)
  • tfsdk: Raise framework errors instead of generic upstream errors or panics when encountering unexpected values with Set() methods (#715)

v1.2.0

21 Mar 13:24
Compare
Choose a tag to compare

NOTES:

  • New DEBUG level Detected value change between proposed new state and prior state log messages with the offending attribute path are now emitted when proposed new state value differences would cause the framework to automatically mark all unconfigured Computed attributes 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 DEBUG logging to aid troubleshooting unexpected plans with unknown values (#630)
  • types/basetypes: Add BoolValue type NewBoolPointerValue() creation function and ValueBoolPointer() method (#689)
  • types/basetypes: Add Float64Value type NewFloat64PointerValue() creation function and ValueFloat64Pointer() method (#689)
  • types/basetypes: Add Int64Value type NewInt64PointerValue() creation function and ValueInt64Pointer() method (#689)
  • types/basetypes: Add StringValue type NewStringPointerValue() creation function and ValueStringPointer() method (#689)
  • resource/schema: Added Default fields to Attribute types, which support schema-based default values (#674)

BUG FIXES:

  • types/basetypes: Fixed Float64Type type ValueFromTerraform method to handle valid, stringified numbers from Terraform (#648)
  • resource: Prevented nested attribute and block plan modifications from being undone (#669)

v1.1.1

13 Jan 19:40
ca9f4fa
Compare
Choose a tag to compare

BUG FIXES:

  • all: Prevented tftypes.NewValue can't use []tftypes.Value as a tftypes.Object panics with schemas that included SingleNestedBlock (#624)

v1.1.0

13 Jan 14:44
67eb102
Compare
Choose a tag to compare

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, and State type PathMatches() method logic previously returned Invalid Path Expression for Schema Data errors 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 Expressions type Matches method 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 blocks errors for responses containing Plan and State types (#621)

BUG FIXES:

  • datasource/schema: Prevented ListNestedBlock and SetNestedBlock type DeprecationMessage field from causing Block Deprecated warnings with unconfigured blocks (#604)
  • datasource: Prevented ConfigValidators from unexpectedly modifying or removing prior validator diagnostics (#619)
  • provider/schema: Prevented ListNestedBlock and SetNestedBlock type DeprecationMessage field from causing Block Deprecated warnings with unconfigured blocks (#604)
  • provider: Prevented ConfigValidators from unexpectedly modifying or removing prior validator diagnostics (#619)
  • resource/schema: Prevented ListNestedBlock and SetNestedBlock type DeprecationMessage field from causing Block Deprecated warnings with unconfigured blocks (#604)
  • resource: Prevented ConfigValidators from unexpectedly modifying or removing prior validator diagnostics (#619)
  • tfsdk: Fixed false positive Invalid Path Expression for Schema Data error to be schema-determined instead of data-determined (#602)
  • types/basetypes: Fixed ObjectType type ApplyTerraform5AttributePathStep method to return an error instead of nil for invalid attribute name steps (#602)

v1.0.1

19 Dec 17:54
c28e463
Compare
Choose a tag to compare

BUG FIXES:

  • resource/schema/planmodifier: Prevented assignment to entry in nil map panic for Object type plan modifiers (#591)
  • types/basetypes: Prevented type mutation via the ObjectType type AttributeTypes() method return (#591)
  • types/basetypes: Prevented value mutation via the ListValue, MapValue, and SetValue type Elements() method return (#591)
  • types/basetypes: Prevented value mutation via the ObjectValue type AttributeTypes() and Attributes() method returns (#591)

v1.0.0

13 Dec 19:16
d540a40
Compare
Choose a tag to compare

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 basetypes package. Value creation functions and type aliases have been created in the types package that should prevent any breaking changes. (#567)

BREAKING CHANGES:

  • provider: The Provider interface now requires the Metadata method. It can be left empty or set the MetadataResponse type TypeName field to populate datasource.MetadataRequest and resource.MetadataRequest type ProviderTypeName fields. (#580)
  • resource: The RequiresReplace() plan modifier has been removed. Use a type-specific plan modifier instead, such as resource/schema/stringplanmodifier.RequiresReplace() or resource/schema/stringplanmodifier.RequiresReplaceIfConfigured() (#576)
  • resource: The RequiresReplaceIf() plan modifier has been removed. Use a type-specific plan modifier instead, such as resource/schema/stringplanmodifier.RequiresReplaceIf() (#576)
  • resource: The Resource type GetSchema method has been removed. Use the Schema method instead. (#576)
  • resource: The StateUpgrader type PriorSchema field type has been migrated from tfsdk.Schema to resource/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 as resource/schema/stringplanmodifier.UseStateForUnknown() (#576)
  • tfsdk: The AttributePlanModifier interface has been removed. Use the type-specific plan modifier interfaces in the resource/schema/planmodifier package instead. (#576)
  • tfsdk: The AttributeValidator interface has been removed. Use the type-specific validator interfaces in the schema/validator package instead. (#576)
  • tfsdk: The Attribute, Block, and Schema types have been removed. Use the similarly named types in the datasource/schema, provider/schema, and resource/schema packages instead. (#576)
  • tfsdk: The ListNestedAttributes, MapNestedAttributes, SetNestedAttributes, and SingleNestedAttributes functions have been removed. Use the similarly named types in the datasource/schema, provider/schema, and resource/schema packages instead. (#576)
  • types: The type-specific Typable and Valuable interfaces have been moved into the underlying basetypes package. (#567)

FEATURES:

  • types/basetypes: New package which contains embeddable types for custom types (#567)

BUG FIXES:

  • datasource: Add Validate function to Schema to prevent usage of reserved and invalid names for attributes and blocks (#548)
  • provider: Add Validate function to MetaSchema to prevent usage of reserved and invalid names for attributes and blocks (#548)
  • provider: Add Validate function to Schema to prevent usage of reserved and invalid names for attributes and blocks (#548)
  • resource: Add Validate function to Schema to prevent usage of reserved and invalid names for attributes and blocks (#548)

v0.17.0

30 Nov 19:34
54ed5dc
Compare
Choose a tag to compare

NOTES:

  • datasource: The DataSource type GetSchema method has been deprecated. Use the Schema method instead. (#546)
  • provider: The Provider type GetSchema method has been deprecated. Use the Schema method instead. (#553)
  • resource: The RequiresReplace() plan modifier has been deprecated. Use a type-specific plan modifier instead, such as resource/schema/stringplanmodifier.RequiresReplace() or resource/schema/stringplanmodifier.RequiresReplaceIfConfigured() (#565)
  • resource: The RequiresReplaceIf() plan modifier has been deprecated. Use a type-specific plan modifier instead, such as resource/schema/stringplanmodifier.RequiresReplaceIf() (#565)
  • resource: The Resource type GetSchema method has been deprecated. Use the Schema method instead. (#558)
  • resource: The UseStateForUnknown() plan modifier has been deprecated. Use a type-specific plan modifier instead, such as resource/schema/stringplanmodifier.UseStateForUnknown() (#565)
  • tfsdk: The Attribute, Block, and Schema types have been deprecated. Use the similarly named types in the datasource/schema, provider/schema, and resource/schema packages instead. (#563)
  • tfsdk: The ListNestedAttributes, MapNestedAttributes, SetNestedAttributes, and SingleNestedAttributes functions have been deprecated. Use the similarly named types in the datasource/schema, provider/schema, and resource/schema packages instead. (#563)

BREAKING CHANGES:

  • provider: The ProviderWithMetaSchema type GetMetaSchema method has been replaced with the MetaSchema method (#562)
  • tfsdk: The Attribute type FrameworkType() method has been removed. Use the GetType() method instead which returns the same information. (#543)
  • tfsdk: The Attribute type GetType() method now returns type information whether the attribute implements the Type field or Attributes field. (#543)
  • tfsdk: The Config, Plan, and State type Schema field type has been updated from tfsdk.Schema to the generic fwschema.Schema interface 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 stringplanmodifier which 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)

v0.16.0

15 Nov 17:36
85c0b3f
Compare
Choose a tag to compare

BREAKING CHANGES:

  • types: The Bool type Null, Unknown, and Value fields have been removed. Use the BoolNull(), BoolUnknown(), and BoolValue() creation functions and IsNull(), IsUnknown(), and ValueBool() methods instead. (#523)
  • types: The Float64 type Null, Unknown, and Value fields have been removed. Use the Float64Null(), Float64Unknown(), and Float64Value() creation functions and IsNull(), IsUnknown(), and ValueFloat64() methods instead. (#523)
  • types: The Int64 type Null, Unknown, and Value fields have been removed. Use the Int64Null(), Int64Unknown(), and Int64Value() creation functions and IsNull(), IsUnknown(), and ValueInt64() methods instead. (#523)
  • types: The List type Elems, ElemType, Null, and Unknown fields have been removed. Use the ListNull(), ListUnknown(), ListValue(), and ListValueMust() creation functions and Elements(), ElementsAs(), ElementType(), IsNull(), and IsUnknown() methods instead. (#523)
  • types: The Map type Elems, ElemType, Null, and Unknown fields have been removed. Use the MapNull(), MapUnknown(), MapValue(), and MapValueMust() creation functions and Elements(), ElementsAs(), ElementType(), IsNull(), and IsUnknown() methods instead. (#523)
  • types: The Number type Null, Unknown, and Value fields have been removed. Use the NumberNull(), NumberUnknown(), and NumberValue() creation functions and IsNull(), IsUnknown(), and ValueBigFloat() methods instead. (#523)
  • types: The Object type Attrs, AttrTypes, Null, and Unknown fields have been removed. Use the ObjectNull(), ObjectUnknown(), ObjectValue(), and ObjectValueMust() creation functions and As(), Attributes(), AttributeTypes(), IsNull(), and IsUnknown() methods instead. (#523)
  • types: The Set type Elems, ElemType, Null, and Unknown fields have been removed. Use the SetNull(), SetUnknown(), SetValue(), and SetValueMust() creation functions and Elements(), ElementsAs(), ElementType(), IsNull(), and IsUnknown() methods instead. (#523)
  • types: The String type Null, Unknown, and Value fields have been removed. Use the StringNull(), StringUnknown(), and StringValue() creation functions and IsNull(), IsUnknown(), and ValueString() methods instead. (#523)

ENHANCEMENTS:

  • attr: Added ValueState type, which custom types can use to consistently represent the three possible value states (known, null, and unknown) (#523)
  • types: Added BoolTypable and BoolValuable interface types, which enable embedding existing boolean types for custom types (#536)
  • types: Added Float64Typable and Float64Valuable interface types, which enable embedding existing float64 types for custom types (#536)
  • types: Added Int64Typable and Int64Valuable interface types, which enable embedding existing int64 types for custom types (#536)
  • types: Added ListTypable and ListValuable interface types, which enable embedding existing list types for custom types (#536)
  • types: Added MapTypable and MapValuable interface types, which enable embedding existing map types for custom types (#536)
  • types: Added NumberTypable and NumberValuable interface types, which enable embedding existing number types for custom types (#536)
  • types: Added ObjectTypable and ObjectValuable interface types, which enable embedding existing object types for custom types (#536)
  • types: Added SetTypable and SetValuable interface types, which enable embedding existing set types for custom types (#536)
  • types: Added StringTypable and StringValuable interface types, which enable embedding existing string types for custom types (#536)

BUG FIXES:

  • types: Prevented Terraform errors where the zero-value for any attr.Value types such as String would be a known value instead of null (#523)
  • types: Prevented indeterminate behavior for any attr.Value types where they could be any combination of null, unknown, and/or known (#523)