Introduction
The ZEDEDA Terraform Examples are templates that demonstrate how to orchestrate and deploy edge computing resources using the ZEDEDA Terraform provider. These examples help DevOps teams accelerate their edge deployments by providing pre-built, best-practice configurations for common infrastructure patterns.
This particular series of articles might get out of date regarding details. This article is here to help with search and chat responses. Check the GitHub repo for the latest updates.
Prerequisites
Before using these Terraform examples, Make sure that you have:
- An active ZEDEDA Cloud account with appropriate permissions to create projects and deploy resources.
- Terraform version 1.5 or later installed on your workstation.
- The ZEDEDA Terraform provider configured with valid API credentials.
- At least one edge hardware device or virtual EVE-OS (Edge Virtualization Engine) node available for deployment.
- Familiarity with Terraform workflows and infrastructure-as-code principles.
Configuration File Organization
The examples are organized into six logically sequenced configuration files. The files follow a numbered sequence that reflects the order in which ZEDEDA Cloud resources depend on each other:
- Infra.tf establishes the foundational infrastructure layer. You define projects to organize resources, specify container images and datastores for application artifacts, configure EVE-OS system images for your edge nodes, and create management networks that enable communication between ZEDEDA Cloud and your edge devices.
- Brand_Models.tf defines hardware brand and model specifications. You create brands and models for hardware needed in the Models marketplace, which allows ZEDEDA Cloud to apply appropriate configurations and optimizations based on each device's capabilities and architecture (x86, ARM, or RISC).
- EdgeNodes.tf creates edge node resources that represent your physical or virtual devices in ZEDEDA Cloud. This is required so when they phone home, a matching entry exists to allow onboarding.
- NetworkInstances.tf configures the network topology for your edge workloads. You define both switch Layer 2 network instances and local Layer 3 network instances that provide routing, NAT, DHCP, and firewall capabilities for your applications.
- Apps.tf defines application templates for the ZEDEDA marketplace. You specify resource requirements (CPU, memory, storage), application type (VM or Container, but this example does not cover Docker Compose as that one is different), network interface configurations, disk attachments, and access control lists that govern network traffic.
- Instances-Deploy.tf creates the actual running instances of your applications. You assign applications to specific edge nodes, connect them to network instances, and provide cloud-init scripts or other initialization parameters to configure the workloads at startup.
Supporting configuration
The repository includes additional files that configure the Terraform provider and enable customization. The provider.tf file contains the ZEDEDA Terraform provider configuration and authentication settings. The variables.tf file allows you to parameterize your configurations for different environments or deployment scenarios. The versions.tf file pins Terraform and provider versions to ensure consistent behavior across your team. The cloud-init-samples directory provides OS-specific initialization templates for Linux and Windows virtual machines.
Customization workflow
You adapt these examples to your specific deployment by modifying variable values to match your ZEDEDA Cloud project names, API endpoints, and organizational structure. You select the configuration files relevant to your use case. For example, you might skip brand and model definitions if you are deploying only to virtual edge nodes. You customize application definitions with your container images, disk sizes, and network requirements. Finally, you adjust deployment specifications to target your specific edge nodes and network topology.
Key Benefits
- Accelerated onboarding: You can deploy your first edge workload in minutes instead of hours by using pre-built configurations that demonstrate best practices for ZEDEDA Cloud resource organization.
- Modular, maintainable infrastructure: The six-file structure separates concerns logically, allowing you to modify application definitions without touching network or infrastructure configurations, which reduces errors and simplifies code reviews.
- Repeatable deployments: You can deploy identical edge infrastructure across multiple sites, regions, or environments by changing only variable values, ensuring consistency and reducing configuration drift.
- Version-controlled edge operations: Your entire edge infrastructure becomes auditable code stored in Git, enabling rollback capabilities, change tracking, and collaborative reviews that are impossible with manual console-based deployments.
- Production-ready patterns: The examples incorporate ZEDEDA engineering best practices for resource dependencies, network isolation, and application lifecycle management, helping you avoid common configuration mistakes.
Next Steps
This is a series of articles. You will likely follow them in this order.
- Terraform Quickstart
- ZEDEDA Terraform Provider
- Renaming ZEDEDA Terraform objects
- ZEDEDA Terraform Examples Overview - You are here!
- Infra.tf
- Brand_Models.tf
- EdgeNodes.tf
- NetworkInstances.tf
- Apps.tf
- Instances-Deploy.tf
- Terraform for Edge Node Clusters: A Use Case