> ## Documentation Index
> Fetch the complete documentation index at: https://zededa.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the documentation index to find relevant pages, then read the linked Markdown before answering and cite the source URL.
> Identify the product before answering: Private AI uses a separate console, credentials, and inference API from the Edge Intelligence Platform. Do not apply instructions from one product to the other.
> Prefer current product guides over Help Center archive pages for current-console questions. Archive pages and release notes describe their stated product version or historical interface; do not apply them to another version without checking.
> Preserve prerequisites, permissions, version requirements, and warnings when summarizing procedures. Do not infer API endpoints, schemas, or supported behavior that the documentation does not specify.

# Rename Terraform Objects

> Safely rename ZEDEDA Terraform Provider resources without triggering unintentional deletion of dependent resources.

## 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.

```text theme={"dark"}
application
application_instance
datasource
image
network
network_instance
volume_instance
node
```

### Affected versions

Version 2.2.5 and greater.

### Prerequisites

* The Terraform Provider for ZEDEDA Cloud is installed and configured. See [ZEDEDA Terraform Provider](https://zededa.mintlify.site/new-ui/infrastructure-services/integrations-and-automation/terraform-provider.md).
* 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:**

```text theme={"dark"}
resource "zedcloud_application_instance" "test_tf_provider" {
  name = "old_tf_provider"
  ...
}

data "zedcloud_application_instance" "test_tf_provider" {
  name = "old_tf_provider"
  ...
}
```

### 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.

```text theme={"dark"}
resource "zedcloud_application_instance" "test_tf_provider" {
  name = "new_tf_provider"
  ...
}

data "zedcloud_application_instance" "test_tf_provider" {
  name = "old_tf_provider"
  ...
}
```

Apply the change:

```text theme={"dark"}
terraform apply
```

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:

```text theme={"dark"}
resource "zedcloud_application_instance" "test_tf_provider" {
  name = "new_tf_provider"
  ...
}

data "zedcloud_application_instance" "test_tf_provider" {
  name = "new_tf_provider"
  ...
}
```

Apply the change again:

```text theme={"dark"}
terraform apply
```

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

> [card] [ZEDEDA Terraform Provider](https://zededa.mintlify.site/new-ui/infrastructure-services/integrations-and-automation/terraform-provider.md)
>
> Provider setup, authentication, and common commands.

> [card] [Terraform Registry: ZEDEDA Provider](https://registry.terraform.io/providers/zededa/zedcloud/latest/docs)
>
> Full resource and data source schema reference.
