Workloads resources
Azion Terraform Provider resources and data sources that create, deploy, and read workloads: azion_workload and azion_workload_deployment.
A workload is the deployment unit of the Azion Platform: it represents an application or a service that Azion’s distributed infrastructure delivers. The Azion Terraform Provider manages Workloads with two resources and reads them with four data sources. One workload can have several deployments, and each deployment is a separate azion_workload_deployment resource. In provider v1.x, a single domain resource did the work of these two resources. To move a v1.x configuration to them, refer to Migrate from provider v1.x to v2.0.
Workload resources
| Resource | Description |
|---|---|
azion_workload | Creates and manages a workload. |
azion_workload_deployment | Creates and manages a deployment of a workload. |
azion_workload requires name, a string that holds the unique name of the workload, and exports id, a string that holds the unique ID of the workload. azion_workload_deployment requires workload_id, a string that holds the ID of the workload it deploys. The Terraform Registry page of each resource lists every argument.
Data sources
| Data source | Description |
|---|---|
azion_workloads | Lists workloads. |
azion_workload | Reads one workload. |
azion_workload_deployments | Lists workload deployments. |
azion_workload_deployment | Reads one deployment. |
Example
This configuration pins the provider, creates a workload and one deployment of it, reads the existing workloads, and outputs the ID of the workload. It reads your personal token from the api_token variable that the Azion Terraform Provider quickstart declares.