Applications resources
Azion Terraform Provider resources and data sources that manage applications, cache settings, Rules Engine rules, device groups, and function instances.
An application carries the content delivery logic of the Azion Platform: its cache settings, the Rules Engine rules that process each request, its device groups, and the function instances it runs. The Azion Terraform Provider manages Applications with five resources and reads them with nine data sources. To move a v1.x configuration to these resources, refer to Migrate from provider v1.x to v2.0.
Application resources
| Resource | Description |
|---|---|
azion_application_main_setting | Creates and manages the main settings of an application. |
azion_application_cache_setting | Creates and manages a cache setting. |
azion_application_device_group | Creates and manages a device group. |
azion_application_rule_engine | Creates and manages a Rules Engine rule. |
azion_application_functions_instance | Creates and manages a function instance in an application. |
azion_application_main_setting requires name, a string that holds the name of the application. A cache setting, a Rules Engine rule, and a function instance belong to one application, so each of their resources takes the ID of that application in application_id. Cache settings and rules also take a name, and a rule takes the phase it runs in. azion_application_functions_instance takes function_id, the ID of a function that the azion_function resource manages. The Terraform Registry page of each resource lists every argument.
Data sources
| Data source | Description |
|---|---|
azion_application_main_settings | Queries the main settings of applications. |
azion_application_cache_settings | Lists cache settings. |
azion_application_cache_setting | Reads one cache setting. |
azion_application_device_groups | Lists device groups. |
azion_application_device_group | Reads one device group. |
azion_application_rules_engine | Lists Rules Engine rules. |
azion_application_rule_engine | Reads one Rules Engine rule. |
azion_application_functions_instances | Lists function instances. |
azion_application_functions_instance | Reads one function instance. |
Example
This configuration pins the provider to version 2.0.0, creates an application, adds a cache setting and a Rules Engine rule in the request phase, instantiates a function in the application, and outputs the ID of the application. It reads your personal token from the api_token variable that the Azion Terraform Provider quickstart declares. The function instance reads function_id from an azion_function resource named my_function, which this configuration does not declare. To look up that resource, refer to Resources and data sources.