Skip to content

Releases: hashicorp/terraform-plugin-framework

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)

v0.15.0

26 Oct 12:48
1ee1a4f
Compare
Choose a tag to compare

NOTES:

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

ENHANCEMENTS:

  • types: Added BoolNull(), BoolUnknown(), and BoolValue() functions, which create immutable Bool values (#502)
  • types: Added Bool type ValueBool() method, which returns the bool of the known value or false if null or unknown (#502)
  • types: Added Float64Null(), Float64Unknown(), and Float64Value() functions, which create immutable Float64 values (#502)
  • types: Added Float64 type ValueFloat64() method, which returns the float64 of the known value or 0.0 if null or unknown (#502)
  • types: Added Int64Null(), Int64Unknown(), and Int64Value() functions, which create immutable Int64 values (#502)
  • types: Added Int64 type ValueInt64() method, which returns the int64 of the known value or 0 if null or unknown (#502)
  • types: Added ListNull(), ListUnknown(), ListValue(), and ListValueMust() functions, which create immutable List values (#502)
  • types: Added ListValueFrom(), MapValueFrom(), ObjectValueFrom(), and SetValueFrom() functions, which can create value types from standard Go types using reflection similar to tfsdk.ValueFrom() (#522)
  • types: Added List type Elements() method, which returns the []attr.Value of the known values or nil if null or unknown (#502)
  • types: Added MapNull(), MapUnknown(), MapValue(), and MapValueMust() functions, which create immutable Map values (#502)
  • types: Added Map type Elements() method, which returns the map[string]attr.Value of the known values or nil if null or unknown (#502)
  • types: Added NumberNull(), NumberUnknown(), and NumberValue() functions, which create immutable Number values (#502)
  • types: Added Number type ValueBigFloat() method, which returns the *big.Float of the known value or nil if null or unknown (#502)
  • types: Added SetNull(), SetUnknown(), SetValue(), and SetValueMust() functions, which create immutable Set values (#502)
  • types: Added Set type Elements() method, which returns the []attr.Value of the known values or nil if null or unknown (#502)
  • types: Added StringNull(), StringUnknown(), and StringValue() functions, which create immutable String values (#502)
  • types: Added String type ValueString() method, which returns the string of the known value or "" if null or unknown (#502)

v0.14.0

04 Oct 17:21
56ca8c9
Compare
Choose a tag to compare

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 Type interface now requires the ValueType method, which is used for enhancing error diagnostics from the framework (#497)

ENHANCEMENTS:

  • internal/reflect: Added attr.Value type suggestions to error diagnostics (#497)

v0.13.0

15 Sep 16:48
65fd838
Compare
Choose a tag to compare

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 DataSource interface now requires the GetSchema and Metadata methods. (#478)
  • provider: The DataSourceType and ResourceType types have been removed. Use the GetSchema, Metadata, and optionally the Configure methods on datasource.DataSource and resource.Resource implementations instead. (#478)
  • provider: The Provider interface GetDataSources and GetResources methods have been removed. Use the DataSources and Resources methods instead. (#478)
  • resource: The Resource interface now requires the GetSchema and Metadata methods. (#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, and AttributeState values (#479)
  • types: Ensured List, Map, and Set types with xattr.TypeWithValidate elements run validation on those elements (#481)

v0.12.0

12 Sep 15:46
152f771
Compare
Choose a tag to compare

NOTES:

  • datasource: The DataSource type GetSchema and Metadata methods will be required in the next version. (#472)
  • provider: The DataSourceType type has been deprecated in preference of moving the GetSchema method to the datasource.DataSource type and optionally implementing the NewResource method logic to a new Configure method. The DataSourceType type will be removed in the next version. (#472)
  • provider: The Provider type GetDataSources method has been deprecated in preference of the DataSources method. All datasource.DataSource types must implement the Metadata method after migrating. Support for the GetDataSources method will be removed in the next version. (#472)
  • provider: The Provider type GetResources method has been deprecated in preference of the Resources method. All resource.Resource types must implement the Metadata method after migrating. Support for the GetResources method will be removed in the next version. (#472)
  • provider: The ResourceType type has been deprecated in preference of moving the GetSchema method to the resource.Resource type and optionally implementing the NewResource method logic to a new Configure method. The ResourceType type will be removed in the next version. (#472)
  • resource: The Resource type GetSchema and Metadata methods will be required in the next version. (#472)

BREAKING CHANGES:

  • tfsdk: The Schema type AttributeAtPath() method signature has be updated with a path.Path parameter and diag.Diagnostics return. Use the AttributeAtTerraformPath() method instead if *tftypes.AttributePath or specific error handling is still necessary. (#450)
  • tfsdk: The previously deprecated Schema type AttributeType() method has been removed. Use the Type() method instead. (#450)
  • tfsdk: The previously deprecated Schema type AttributeTypeAtPath() method has been removed. Use the TypeAtPath() or TypeAtTerraformPath() method instead. (#450)
  • tfsdk: The previously deprecated Schema type TerraformType() method has been removed. Use Type().TerraformType() instead. (#450)

ENHANCEMENTS:

  • datasource: Added DataSource type Configure, GetSchema, and Metadata method support (#472)
  • provider: Added ConfigureResponse type DataSourceData field, which will set the datasource.ConfigureRequest.ProviderData field (#472)
  • provider: Added ConfigureResponse type ResourceData field, which will set the resource.ConfigureRequest.ProviderData field (#472)
  • provider: Added Provider type Metadata method support, which the MetadataResponse.TypeName field will set the datasource.MetadataRequest.ProviderTypeName and resource.MetadataRequest.ProviderTypeName fields (#472)
  • resource: Added Resource type Configure, GetSchema, and Metadata method 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)