Quick Start Guide - Terraform Provider
Get started with the Azion Terraform Provider in minutes. This guide shows you how to configure the provider, create basic resources, and apply your first infrastructure as code.
This guide shows you how to get started with the Azion Terraform Provider to manage your infrastructure as code.
Prerequisites
Before you begin, make sure you have:
- Terraform version 1.0 or higher installed
- An active Azion account
- A Personal Token with appropriate permissions
Step 1: Install Terraform
You must have Terraform Core installed in your environment. See how to install.
Verify the installation:
Step 2: Configure the Provider
Create a new directory for your Terraform project:
Create the main.tf file:
Step 3: Configure Authentication
Option 1: Environment Variable (Recommended)
Option 2: Variables File
Create variables.tf:
Create terraform.tfvars (add to .gitignore):
Update main.tf:
Step 4: Create Your First Infrastructure
Create resources.tf:
Step 5: Initialize and Apply
Initialize Terraform
Verify the Plan
Apply Changes
Type yes when prompted to confirm.
Step 6: Verify Resources
Quick Start Example
Here’s a complete example to get you started with Azion Terraform Provider v2.0:
Project Structure
A recommended structure for larger projects:
Next Steps
- Workloads - Learn about workloads
- Applications - Configure applications
- Security - Configure firewall and WAF
- Best Practices - Best practices for usage
Troubleshooting
Authentication Error
Solution: Verify that the token is correctly configured via environment variable or configuration file.
Incompatible Version
Solution: Verify that you’re using Terraform 1.0 or higher.
Resources Not Found
Solution: Verify that the resource exists in API v4. Some v3 resources were removed or renamed. See the Migration Guide.