Consider adding a PlanCheck
that verifies a resource is replaced - ExpectResourceReplacePaths
#107
Labels
enhancement
New feature or request
Description
After #63 is merged, we can create new built-in plan checks that may be useful for provider testing.
The plan contains change information for resources that indicate what object values resulted in a resource being replaced (deleted, then re-created):
This could be useful for provider developers that need to ensure that certain config changes result in a full delete/create, rather than an update in-place.
We'll need to ensure the terraform-json package is updated to marshal this
replace_paths
attributeOther considerations
This implementation should also consider if the testing framework needs to build it's own path system to support functionality like this. The testing code is already leaning on a custom flatmap/HCL reference string syntax, but it can be confusing for developers and required non-HCL-existent syntax for set type attributes since they cannot be indexed.
terraform-plugin-framework's
path
package is available, but potentially awkward to link together with the actual JSON paths without also introducing JSON schema handling into the testing code. It would also be a goal to not import the framework code so the testing module remains portable across any existing or future Go-based SDKs.The text was updated successfully, but these errors were encountered: