Terraform Plugin Framework ForceNew

Hi, I am currently developing a provider with the new terraform plugin framework.

I am unable to find a way to indicate, that a change in the configuration is forcing the resource to be replaced. Apparently in the terraform plugin sdk this can be indicated with the ForceNew flag within the resource schema.

Does anyone know how this is done in the framework, or is it not yet supported?

Best regards,
Thomas

You are looking for the function func RequiresReplace(), which acts exactly like ForceNew on SDKv2. You can read the doc here:

https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework/tfsdk#RequiresReplace

2 Likes

Thank you for your swift response, works perfectly :slight_smile: