
6 October 2026 · 5 min read
The steps to define development, test and production environments as code with Terraform, so they come up in minutes and the same way every time.
Bulutlan Edge Cloud supports infrastructure as code with Terraform. In the words of our infrastructure partner RNG Technology, setups that used to take weeks or months come down to minutes, and human error goes down. This guide walks through the steps to build a repeatable environment with Terraform, at a conceptual level.
The guide is not tied to a specific provider version or code sample. For the current provider configuration and connection details to use with the platform, ask our support team.
Start by designing your environments before writing any code. A common structure has development, test and production environments. Keeping each environment in its own project with Multi-Tenancy makes it easier to separate permissions and costs.
Split your code into shared modules and environment-specific settings. Write components such as the network, server group and load balancer as modules, so that only variables like server count, profile and network ranges differ between environments.
Never write credentials into the code or push them to the repository. Use environment variables or a secrets management tool instead. Defining a separate user for Terraform with only the permissions it needs limits the impact of a potential leak. Role-based access control in Edge Cloud lets you make that separation.
Your first module is usually the network: VPC, subnets, routing and firewall rules. Placing the application, database and management tiers in separate subnets keeps security rules simple. Pick address ranges that do not overlap between environments; you may need to connect them later.
In server definitions, leave the profile (Z2, Z4, Z8, Z16), operating system image, disk type and size as variables. That way the same code runs small profiles in development and larger ones in production. Use SSD for performance-sensitive disks and NL-SAS for capacity-focused ones.
Add load balancer and Auto-Scale definitions for your web or API tier to the code as well. According to RNG Technology, the load balancer can be applied automatically with Auto-Scale or Terraform. Define minimum, desired and maximum capacity as environment variables.
Use Terraform's plan step to preview the changes. Make the plan output part of your code review, paying special attention to resources that will be deleted or recreated. Once the plan is approved, apply the changes and check the results in Cloud Console.
Terraform tracks the resources it manages in a state file. This file may contain sensitive information and needs to be shared within the team:
Once your code is ready, building a new environment comes down to applying the same modules with a new variables file. When the work is done, you can remove a temporary test environment entirely with Terraform. The server, disk and IP costs of that environment go away with it.
When an enterprise customer asks for its own isolated environment, create a new variables file with values such as the customer name, network range and capacity. With the same modules, a customer-dedicated project, network, server group and load balancer come up in minutes. Every customer environment stays on the same standard, and updates are managed from a single codebase.
Related pages: Infrastructure as Code, Multi-Tenancy, Auto-Scale with a Load Balancer guide.