Terraform Error after Migrating to Version 1.0.0: "auth0_trigger_binding.password_change_flow"

Problem statement

When using Auth0 Terraform Provider to manage our infrastructure and migrating to version 1.0.0 of the Terraform provider (GitHub - auth0/terraform-provider-auth0: The Auth0 Terraform Provider is the official plugin for managing Auth0 tenant configuration through the Terraform tool.), an error occurs that relates to the old schema.

During the execution of the tool, when attempting to update the configuration, the following error occurs:

Error: no schema available for auth0_trigger_binding.password_change_flow while reading state

What might be causing this error?

Symptoms

Following a migration to version 1.0.0 of the Terraform provider, this error is thrown when there is an attempt to update the configuration:

Error: no schema available for auth0_trigger_binding.password_change_flow while reading state

Cause

This issue occurs because there is no longer a resource named auth0_trigger_binding. In the new version, it is now auth0_trigger_actions.

Solution

The following advice is primarily relevant to version 1.0.0 of the Terraform provider, though it may also be relevant to later versions.

When upgrading from an earlier version of the Terraform provider, carefully check the contents of the Migration guide to make sure that no steps have been missed.

This particular issue can be resolved with these steps:

  1. Run: terraform state rm auth0_trigger_binding.password_change_flow
  2. Renaming resource from auth0_trigger_binding.password_change_flow to auth0_trigger_actions.password_change_flow
  3. Run: terraform import auth0_trigger_actions.password_change_flow post-change-password