How to Create Terraform Templates
This guide explains how to create a Terraform template in the GlobalAI platform, including how to define configuration details, provide Terraform code, and set deployment lifecycle rules.
Create a new Terraform Template
To start creating a new template, follow the steps below.
- In the left sidebar, expand the Infrastructure dropdown menu and select Terraform Templates.
- Click + Create template in the top-right corner. This opens the template creation form.

- Fill in the following fields:
- Name: Enter a unique name for the template.
- Owner: Specify the owner of the template.
- Description: Provide a short explanation of what the template provisions.
- Tags: Add relevant tags to help categorize the template (for example,
aws,prod).
- Provide the Terraform code using any of the configuration methods available.

Configuration methods
You can provide the Terraform configuration using one of the methods described below.
Option 1: Upload a configuration archive.
This is the recommended option for Terraform projects with multiple files.
- Locate the Configuration archive field.
- Click Click to upload.
- Select a
.zipor.tar.gzfile containing your Terraform configuration.
Ensure the archive includes only the required Terraform files and excludes state files or secrets.
Option 2: Edit configuration text.
For simple or single-file configurations, you can use the built-in editor.
- Locate the Configuration text field.
- Click Edit.
- Enter your Terraform configuration code.
- Click Save to close the editor.
Set the deployment lifecycle
The deployment lifecycle defines how long the infrastructure remains active and what happens when the time expires.
Configure the following settings:
- Environment action: Select the action to take when the deployment time expires.
- Manual: Infrastructure remains active until you manually delete it.
- Terminate: Infrastructure is automatically destroyed after the specified time.
Note that, unlike Kubernetes workloads, Terraform-managed infrastructure cannot be paused or stopped.
- Default time: Set how long the deployment remains active (for example,
30for minutes orP1Dfor one day). - Grace time: Set an additional buffer period before the action is executed (for example,
10for minutes).
Configure input variables
You can define variables that users must provide or that are automatically generated when they deploy this template. This makes your template reusable and dynamic across environments.
- Scroll to the Input variables section.
- Click Add additional parameters and select the data type for your variable.
- The platform supports various formats including String, Numeric, JSON, Code, List, and Boolean.
- Your selected variable appears in a new row below.

- Enter the Key (the variable name used in your Terraform configuration).
- Enter a Value to define a default, or leave it empty to require input during deployment.
- Optionally, select from Available predefined variables to automatically insert system values.
When configuring input variables, you define the values passed into your Terraform configuration. These values can be entered manually or selected from the platform’s predefined variables.
Predefined variables provide platform-generated values that are resolved at runtime and can be used when setting input variable values.
For details on available predefined variable categories and how they work, see the Predefined Variables article.
Finish creation
Once all sections are configured:
- Review the template details.
- Click Create.
The template is added to the Terraform Templates list and is ready to be used for deployments.
Related articles
Now that you know how to create a Terraform template, explore these related guides.
Predefined Variables
Learn how predefined variables work in GlobalAI and how to use them to generate dynamic values in infrastructure configurations.
Add a Cluster on GlobalAI
Connect and configure the Kubernetes clusters where your infrastructure runs.
View Usage Metrics
Track cost and resource consumption for Terraform deployments.