Workloads are the fundamental deployment unit on the Azion Platform. They represent your applications and services that are delivered through the global network of edge nodes.
The azion_workload resource allows you to manage workloads through Terraform. Each workload can have multiple deployments, managed by the azion_workload_deployment resource.
Available Resources
| Resource | Description |
|---|---|
azion_workload | Creates and manages workloads |
azion_workload_deployment | Creates and manages workload deployments |
Available Data Sources
| Data Source | Description |
|---|---|
azion_workloads | Query existing workloads |
azion_workload
Basic Example
resource "azion_workload" "example" { name = "my-workload"
# Workload configuration}Main Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique workload name |
For the complete list of arguments, see the Terraform Registry.
Exported Attributes
| Attribute | Type | Description |
|---|---|---|
id | string | Unique workload ID |
azion_workload_deployment
Basic Example
resource "azion_workload" "example" { name = "my-workload"}
resource "azion_workload_deployment" "example" { workload_id = azion_workload.example.id
# Deployment configuration}Main Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
workload_id | string | Yes | ID of the associated workload |
For the complete list of arguments, see the Terraform Registry.
Complete Example
terraform { required_providers { azion = { source = "aziontech/azion" version = "2.0.0" } }}
provider "azion" { api_token = var.api_token}
# Create a workloadresource "azion_workload" "my_app" { name = "my-application"}
# Create a deployment for the workloadresource "azion_workload_deployment" "my_app_deployment" { workload_id = azion_workload.my_app.id
# Additional deployment configuration}
# Query existing workloadsdata "azion_workloads" "all" {}
output "workload_id" { value = azion_workload.my_app.id}Migrating from Domains (V3 to V4)
If you’re migrating from API v3, the azion_domain resource has been replaced by azion_workload and azion_workload_deployment.
Before (V3)
resource "azion_domain" "example" { name = "my-domain" edge_application = 12345 domain_name = "example.com"}After (V4)
resource "azion_workload" "example" { name = "my-workload"}
resource "azion_workload_deployment" "example" { workload_id = azion_workload.example.id}See the Migration Guide for more details.
Next Steps
- Connectors - Manage origin connectors
- Applications - Manage applications