github hashicorp/terraform-plugin-framework v0.5.0

latest releases: v1.12.0, v1.11.0, v1.10.0...
2 years ago

BREAKING CHANGES:

  • Fixed RequiresReplace and RequiresReplaceIf to be more judicious about when they require a resource to be destroyed and recreated. They will no longer require resources to be recreated when any attribute changes, instead limiting it only to the attribute they're declared on. They will also not require resources to be recreated when they're being created or deleted. Finally, they won't require a resource to be recreated if the user has no value in the config for the attribute and the attribute is computed; this is to prevent the resource from being destroyed and recreated when the provider changes the value without any user prompting. Providers that wish to destroy and recreate the resource when an optional and computed attribute is removed from the user's config should do so in their own plan modifier. (#213)
  • RequiresReplaceIf no longer overrides previous plan modifiers' value for RequiresReplace if the function returns false. (#213)
  • diag: The AttributeErrorDiagnostic and AttributeWarningDiagnostic types have been removed. Any usage can be replaced with DiagnosticWithPath. (#219)
  • tfsdk: The AddAttributeError, AddAttributeWarning, AddError, and AddWarning methods on the ConfigureProviderResponse, CreateResourceResponse, DeleteResourceResponse, ModifyAttributePlanResponse, ModifyResourcePlanResponse, ReadDataSourceResponse, ReadResourceResponse, and UpdateResourceResponse types have been removed in preference of the same methods on the Diagnostics field of these types. For example, code such as resp.AddError("...", "...") can be updated to resp.Diagnostics.AddError("...", "..."). (#198)
  • tfsdk: The Config, Plan, and State type GetAttribute methods now return diagnostics only and require the target as the last parameter, similar to the Get method. (#167)

FEATURES:

  • Added tfsdk.UseStateForUnknown() as a built-in plan modifier, which will automatically replace an unknown value in the plan with the value from the state. This mimics the behavior of computed and optional+computed values in Terraform Plugin SDK versions 1 and 2. Provider developers will likely want to use it for "write-once" attributes that never change once they're set in state. (#204)
  • tfsdk: Support list and set blocks in schema definitions (#188)

ENHANCEMENTS:

  • diag: Added WithPath() function to wrap or overwrite diagnostic path information. (#219)
  • tfsdk: The Config, Plan, and State type GetAttribute methods can now be used to fetch values directly into attr.Value implementations and Go types. (#167)

BUG FIXES:

  • tfsdk: Fetch null values from valid missing Config, Plan, and State paths in GetAttribute() method (#185)
  • types: Ensure Float64 Type() method returns Float64Type (#202)
  • types: Prevent panic with uninitialized Number Value (#200)
  • types: Prevent panics when ValueFromTerraform received nil values (#208)

Don't miss a new terraform-plugin-framework release

NewReleases is sending notifications on new releases.