Skip to main content

Introduction

Some Terraform Provider for ZEDEDA Cloud resources are configured with ForceNew on their name field. When you rename a ForceNew object, the Terraform provider does not update the existing object in place. Instead, it creates a copy of the object with the new name and deletes the original. It also deletes and recreates all objects that depend on the renamed object. This behavior has two important consequences:
  • Dependent objects are deleted silently. The Terraform provider reports when it deletes objects set for re-creation, but it does not report when it deletes their associated dependencies.
  • Deletions are permanent. Deleted objects cannot be recovered.
To rename a ForceNew object safely, you must apply the configuration change in two separate steps rather than changing both the resource definition and the data source definition at the same time.

Affected objects

Only the following objects are affected by this behavior.

Affected versions

Version 2.2.5 and greater.

Prerequisites

  • The Terraform Provider for ZEDEDA Cloud is installed and configured. See ZEDEDA Terraform Provider.
  • You have an existing Terraform configuration managing a resource of one of the affected types.

Rename an Object

The following example shows how to rename an application_instance resource from old_tf_provider to new_tf_provider. Starting configuration:

Step 1: Update the resource definition name and apply

Change the name value in the resource block only. Leave the data source block unchanged for now.
Apply the change:
You might see an error similar to “The requested resource was not found on this server”. Ignore it and proceed to Step 2.

Step 2: Update the data source definition name and apply

Change the name value in the data source block to match the new name:
Apply the change again:
After the second apply completes, the object has been renamed in Edge Infrastructure Services and the Terraform state is consistent.

Why Two Steps Are Required

If you change both the resource definition and the data source definition in a single apply, Terraform attempts to delete the old object and create the new one in the same operation. Because the data source still references the old name during the delete phase, Terraform might attempt to delete dependent resources before the new object exists, which can result in data loss. The two-step approach ensures the new object exists before the data source reference is updated, preventing cascading deletions.

Next Steps

ZEDEDA Terraform Provider

Provider setup, authentication, and common commands.

Terraform Registry: ZEDEDA Provider

Full resource and data source schema reference.