Terraform is an infrastructure as code tool that makes it possible to manage your infrastructure efficiently through code. The files created to manage your infrastructure can be reused, versioned, and shared, helping you to have a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle.
Terraform Provider v2.0 requires API v4. This version is compatible with Azion API v4 only. If you’re using API v3, see the Terraform Provider v1.x documentation.
How does Azion Terraform Provider work?
Terraform works based on providers. A provider is in charge of managing the lifecycle of a particular resource type. They’re implemented as plugins, which are separate executable code files that may be loaded into Terraform at runtime.
Azion Terraform Provider is an open source project, registered in Terraform Registry that uses the Azion SDK (Go) to communicate with the Azion APIs, so you can manage your infrastructure hosted on the Azion platform, locally, as code.
Process

Terraform Core: it communicates with the Azion Terraform Provider.
Note: you must have Terraform Core installed in your environment. See how to install it.
Azion Terraform Provider: built in Go, it communicates with the Azion SDK (Go).
Azion SDK (Go): it communicates with the Azion APIs.
First steps
In your .tf file, you must set the Azion Terraform Provider as the provider and set its version as well, such as:
terraform { required_providers { azion = { source = "aziontech/azion" version = "2.0.0" } }}With the provider configured, it’s recommended to configure a personal token:
provider "azion" { api_token = "your-personal-token"}Note: if the personal token isn’t provided as presented above, a prompt will ask you to inform it when you try to run any Terraform command.
After these steps, you’re ready to get started managing your infrastructure using the Azion Terraform Provider.
Quick Start Example
Here’s a complete example to get you started with Azion Terraform Provider v2.0:
terraform { required_providers { azion = { source = "aziontech/azion" version = "2.0.0" } }}
provider "azion" { api_token = var.api_token}
# Create a workloadresource "azion_workload" "example" { name = "my-workload" # Additional configuration...}
# Create a connectorresource "azion_connector" "example" { name = "my-connector" # Additional configuration...}
# Create an edge applicationresource "azion_edge_application_main_setting" "example" { name = "my-application" # Additional configuration...}Resources by Category
Workloads
| Resource | Description |
|---|---|
| azion_workload | Manage Azion workloads |
| azion_workload_deployment | Manage workload deployments |
Connectors
| Resource | Description |
|---|---|
| azion_connector | Manage Azion connectors |
Applications
| Resource | Description |
|---|---|
| azion_edge_application_main_setting | Manage application main settings |
| azion_edge_application_origin | Manage application origins |
| azion_edge_application_cache_setting | Manage application cache settings |
| azion_edge_application_rule_engine | Manage application rules engine |
| azion_edge_application_edge_functions_instance | Manage application function instances |
| azion_application | Manage applications |
Custom Pages
| Resource | Description |
|---|---|
| azion_custom_page | Manage custom pages |
Edge Functions
| Resource | Description |
|---|---|
| azion_function | Manage Edge Functions |
Edge DNS
| Resource | Description |
|---|---|
| azion_intelligent_dns_zone | Manage DNS zones |
| azion_intelligent_dns_record | Manage DNS records |
| azion_intelligent_dns_dnssec | Manage DNSSEC settings |
Security
| Resource | Description |
|---|---|
| azion_edge_firewall_main_setting | Manage firewall main settings |
| azion_edge_firewall_edge_functions_instance | Manage firewall function instances |
| azion_waf_rule_set | Manage WAF rule sets |
| azion_network_list | Manage network lists |
Certificates
| Resource | Description |
|---|---|
| azion_digital_certificate | Manage digital certificates |
Migrating from v1.x
If you’re upgrading from Terraform Provider v1.x (API v3), see the Terraform Provider Migration Guide for detailed instructions on migrating your configurations to v2.0.