# Azion Terraform Provider v1.x (API v3)

:::warning
**Version 1.x is deprecated.** This documentation is for Terraform Provider v1.x (API v3), which no longer receives updates. For new projects or to access the latest features, use [Terraform Provider v2.0](/en/documentation/products/terraform-provider/) with API v4.

See the [Migration Guide](/en/documentation/products/terraform-provider/terraform-migration-v3-to-v4/) for upgrading from v1.x to v2.0.
:::

[Terraform](https://developer.hashicorp.com/terraform/docs) 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.

---

## How does Azion Terraform Provider work?

**Terraform** works based [on providers](https://developer.hashicorp.com/terraform/registry/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](https://github.com/aziontech/terraform-provider-azion) is an open source project, registered in [Terraform Registry](https://registry.terraform.io/providers/aziontech/azion/latest) that uses [the Azion SDK (Go)](https://github.com/aziontech/azionapi-go-sdk) to communicate with the Azion APIs, so you can manage your infrastructure hosted on the Azion platform, locally, as code.

---

## Process

![Azion Terraform Provider Process](/assets/docs/images/uploads/terraformProviderFlow.png)

**Terraform Core**: it communicates with the Azion Terraform Provider.

> **Note**: you must have Terraform Core installed in your environment. [See how to install it](https://developer.hashicorp.com/terraform/downloads).

**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:

```json
    required_providers {
        source = "aziontech/azion"
        version =  "1.x.y" // it depends on the version you're willing to use.
    }
```

With the provider configured, it's recommended to configure a [personal token](/en/documentation/products/accounts/personal-tokens/):

```json
    provider "azion" {
      api_token  = "token" // Here you place 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.

Here's how your `.tf` should look like at this point:

```json
    required_providers {
            source = "aziontech/azion"
            version = "1.x.y" // it depends on the version you're willing to use.
        }
    provider "azion" {
            api_token  = "token" // Here you place your personal token
     }
```

---

## Implementation

| Scope | Resource | Data source |
| --- | --- | --- |
| Workloads | [Managing domains](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/domain) | [Consulting domains](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/domains) |
| Application | [Managing Functions](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_function) | [Consulting Functions](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_functions) |
|  Edge DNS Zones | [Managing zones](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/intelligent_dns_zone)| [Consulting zones](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/intelligent_dns_zones) |
|  Edge DNS Records | [Managing records](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/intelligent_dns_record) | |
|  Edge DNS DNSSEC | [Managing DNSSEC](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/intelligent_dns_dnssec) | [Consulting DNSSEC](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/intelligent_dns_dnssec)|
|  Applications Functions Instances | [Managing Functions Instances](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_application_edge_functions_instance) | [Consulting Functions Instances](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_application_edge_functions_instance)|
|  Applications Origin | [Managing Origins](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_application_origin) | [Consulting Origins](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_applications_origins)|
|  Applications Main Settings | [Managing Main Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_application_main_setting) | [Consulting Main Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_application_main_settings)|
|  Applications Cache Settings | [Managing Cache Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_application_cache_setting) | [Consulting Cache Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_application_cache_settings)|
|  Applications Rules Engine | [Managing Rules Engine](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_application_rule_engine) | [Consulting Rules Engine](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_application_rules_engine)|
|  Certificate Manager | [Managing Certificate Manager](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/digital_certificate) | [Consulting Certificate Manager](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/digital_certificates)|
|  Environment Variables | [Managing Environment Variables](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/environment_variable) | [Consulting environment variables](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/environment_variables) |
|  Firewall Main Settings | [Managing Main Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_firewall_main_setting) | [Consulting Main Settings](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_firewall_main_settings) |
|  Firewall Functions Instances | [Managing Functions Instances](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/edge_firewall_edge_functions_instance) | [Consulting Functions Instances](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/edge_firewall_edge_function_instances) |
|  Network List | [Managing Network Lists](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/network_list) | [Consulting Network Lists](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/network_lists) |
|  WAF Rules Set | [Managing WAF Rules Set](https://registry.terraform.io/providers/aziontech/azion/latest/docs/resources/waf_rule_set) | [Consulting WAF Rules Set](https://registry.terraform.io/providers/aziontech/azion/latest/docs/data-sources/waf_rule_sets) |

---

## Migration to v2.0

To migrate your Terraform configurations to v2.0 (API v4), see the [Terraform Provider Migration Guide](/en/documentation/products/terraform-provider/terraform-migration-v3-to-v4/).

---