-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helper/schema: Add
Resource
type flags for disabling legacy type sy…
…stem protocol flags Reference: #1227 Introduces new `Resource` type `EnableLegacyTypeSystemApplyErrors` and `EnableLegacyTypeSystemPlanErrors` fields that prevent the `PlanResourceChange` and `ApplyResourceChange` protocol operation responses from setting the `UnsafeLegacyTypeSystem` flag. When Terraform encounters the `UnsafeLegacyTypeSystem` flag, it will demote certain data consistency issues from error diagnostics that would immediately prevent Terraform workflows from completing to warning logs, which can be difficult for provider developers to discover. Provider developers are not generally expected to try enabling these settings unless discovering these data consistency issues upfront is desired before migrating resources to terraform-plugin-framework. This setting is on the individual resource level because these errors can be quite prevalent in existing terraform-plugin-sdk resources and therefore it would be problematic to not give provider developers more control over the behavior. The settings are split between plan and apply because the protocol flag is on two separate protocol operations and because certain errors for one operation may be unavoidable, so it leaves provider developers the option to still raise errors for the other operation. This change set includes new website documentation to discuss these data consistency issues and how to potentially resolve them more in-depth. It is expected that the framework migration guide will be updated to recommend enabling these settings before migrating to help provider developers understand the issues before migrating. The error resolution section has one particular error to start and it is expected that this section will grow over time as provider developers report the various data consistency errors that Terraform can raise.
- Loading branch information
Showing
9 changed files
with
345 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: ENHANCEMENTS | ||
body: 'helper/schema: Added `Resource` type `EnableLegacyTypeSystemApplyErrors` | ||
field, which will prevent Terraform from demoting data consistency errors | ||
to warning logs during `ApplyResourceChange` (`Create`, `Update`, and `Delete`) | ||
operations with the resource' | ||
time: 2023-08-08T11:19:40.137598-04:00 | ||
custom: | ||
Issue: "1227" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: ENHANCEMENTS | ||
body: 'helper/schema: Added `Resource` type `EnableLegacyTypeSystemPlanErrors` | ||
field, which can be used to prevent Terraform from demoting data consistency | ||
errors to warning logs during `PlanResourceChange` operations with the resource' | ||
time: 2023-08-08T11:19:41.137598-04:00 | ||
custom: | ||
Issue: "1227" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
kind: NOTES | ||
body: 'helper/schema: The `Resource` type `EnableApplyLegacyTypeSystemErrors` | ||
and `EnablePlanLegacyTypeSystemErrors` fields can be enabled to more easily | ||
discover resource data consistency errors which Terraform would normally | ||
demote to warning logs. Before enabling the flag in a production release for | ||
a resource, the resource should be exhaustively acceptance tested as there may | ||
be unrecoverable error situations for practitioners. It is recommended to | ||
first enable and test in environments where it is easy to clean up resources, | ||
potentially outside of Terraform.' | ||
time: 2023-08-08T10:37:24.017324-04:00 | ||
custom: | ||
Issue: "1227" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.