Skip to main content

Introduction

The Terraform Provider for ZEDEDA Cloud lets you define and manage your Edge Infrastructure Services configuration as code using HashiCorp Terraform. The provider is an external CLI-based tool that runs on your local system or automation environment. It communicates with Edge Infrastructure Services through the API. The Terraform provider is an alternative to the Edge Infrastructure Services console and zCLI for configuration management. It is best suited for teams that need repeatable, version-controlled infrastructure definitions or integration with CI/CD pipelines.

Limitations

The Terraform provider has two important constraints to be aware of before you begin:
  • Use either the Terraform provider or the console and zCLI — not both. Managing the same resources with the Terraform provider and the Edge Infrastructure Services console (or zCLI) simultaneously is likely to cause configuration conflicts. Choose one management path and use it consistently.
  • Configuration management only. The provider creates, updates, and deletes resources. It does not provide monitoring capability. Use the Edge Infrastructure Services console or zCLI for observability.

Prerequisites

  • You have the SysManager or SysAdmin role in your enterprise. See Manage Roles.
  • Depending on which objects the Terraform configuration will manage, the token must belong to a user with CRUD permissions on those specific object types.
  • Terraform CLI installed on your local system.
  • A ZEDEDA Cloud API token. To generate one, go to your user profile (click your name in the header) and select the API Tokens tab.

How the Provider Works

The Terraform Provider for ZEDEDA Cloud communicates with Edge Infrastructure Services through the API. Terraform Core sends execution commands to the Terraform provider, which calls the Edge Infrastructure Services API. The API returns responses that Terraform uses to reconcile state. ZEDEDA Cloud objects correspond to Terraform resources (for objects you create and manage) and data sources (for objects you reference). For example, zedcloud_edgenode is a resource type, while data.zedcloud_project is a data source type. Diagram showing how Terraform Core communicates with the ZEDEDA Terraform Provider, which calls the Edge Infrastructure Services API

Object Relationships

The following ZEDEDA Cloud object types depend on other objects. You must declare these dependencies correctly in your Terraform configuration file so that Terraform provisions resources in the correct order. Key dependencies:
  • Application instances depend on: volume instances, edge apps, nodes, and network instances.
  • Nodes depend on: networks.
  • Edge apps depend on: images.
You can declare dependencies explicitly using depends_on blocks, or implicitly by referencing other resources or data sources. Implicit dependencies are preferred because Terraform resolves them automatically. Diagram showing the dependency relationships between ZEDEDA Cloud object types including Application Instance, Node, Edge App, Volume Instance, Network Instance, Image, Datastore, and Network For more information on dependency configuration, see Create Resource Dependencies in the Terraform documentation.

Quick Start

The following steps set up the Terraform provider and provision a basic configuration.
  1. Create a directory for your Terraform files:
  2. Create a main.tf file and declare the provider version:
  3. Set the following environment variables in your shell session. Replace the placeholder values with your actual API token and ZEDEDA Cloud URL:
  4. In main.tf, add the provider configuration block and declare the token as a sensitive variable:
    Marking the token as sensitive = true prevents Terraform from displaying it in plan and apply output.
  5. Add the resources you want to manage. See the resource schema documentation on the Terraform Registry for available resource types and their fields. An example main.tf is available in the provider GitHub repository.
  6. Initialize the working directory:
  7. Preview the planned changes:
  8. Apply the configuration:

Common Terraform Commands

Import Existing Resources

You can bring existing Edge Infrastructure Services objects under Terraform management using the terraform import command. This is useful when you have resources created through the Edge Infrastructure Services console or zCLI that you want to start managing with Terraform. To import an existing object:
  1. Obtain the object’s ID using the Edge Infrastructure Services console or zCLI.
  2. Add a corresponding resource block in your Terraform configuration file.
  3. Run the import command using the format terraform import RESOURCE_TYPE.RESOURCE_NAME ID. For example:
Data sources support names as the key rather than IDs. The Terraform provider does not currently support all Edge Infrastructure Services object types as resources. For the current list of supported resource types, see the resource schema documentation. To follow ongoing work to add support for additional resources, see the ZEDEDA Terraform Provider GitHub repository.

Protect Secrets

To protect sensitive values (for example, API tokens, passwords, or private keys) in your Terraform configuration, assign them to environment variables prefixed with TF_VAR_. Terraform automatically reads variables with this prefix and passes them to your configuration without storing them in plain text in your files. For example, to protect a database password:
Declare the variable as sensitive in your configuration:

Next Steps

Rename Terraform Objects

Rename Terraform-managed resources safely without triggering unintended deletions.

Terraform Registry: ZEDEDA Provider

Full resource and data source schema reference.

ZEDEDA Terraform Provider on GitHub

Source code, example configurations, and issue tracker.