evroc Terraform provider
The evroc Terraform provider lets you define and manage evroc cloud infrastructure declaratively using Terraform or OpenTofu.
For installation, examples, and the full resource reference, see the GitHub repository.
Overview
Infrastructure-as-code tools let you describe your cloud resources in configuration files, version-control them, review changes through pull requests, and reproduce environments consistently across development, staging, and production. The evroc Terraform provider brings that workflow to evroc — compute, networking, storage, and IAM resources are all managed as Terraform resources.
The provider builds on the same public APIs as the evroc Console, CLI, and Go SDK, so resources created through any of those tools can be imported into Terraform and managed from there.
Key features
The Terraform provider provides:
- Declarative configuration - Describe the desired state of your infrastructure in HCL; Terraform reconciles the differences
- Plan before apply - Preview the exact create, update, and delete actions before making any changes
- State management - Terraform tracks deployed resources and detects drift
- Dependency resolution - Resource dependencies are inferred from references, and Terraform parallelizes operations where it can
- Import existing resources - Bring resources created via the Console or CLI under Terraform management
- Remote state backend - Store Terraform state in an evroc S3-compatible bucket for team collaboration
- Automatic token refresh - Long-running
terraform applyoperations keep authenticating as tokens expire
The provider manages compute, networking, storage, and IAM resources, with matching data sources for looking up existing resources and discovering available OS images and VM flavors. For the current resource and data source lists, see the coverage tables in the README.
How it works
You declare resources in .tf files and Terraform translates them into API calls against the evroc platform:
resource "evroc_virtual_machine" "web" {
name = "web-server"
flavor = data.evroc_compute_profiles.available.a1a_s
boot_disk = evroc_disk.boot.fqid
zone = "a"
security_groups = [evroc_security_group.allow_ssh.fqid]
public_ip = evroc_public_ip.vm.fqid
}
Running terraform plan compares your configuration against the recorded state and the live API to compute a set of changes. terraform apply executes those changes in dependency order, waiting for each resource to reach a stable state before moving on.
Authentication
The provider reads credentials in the following order:
- Explicit attributes on the
provider "evroc" {}block - Environment variables (
EVROC_TOKEN,EVROC_REFRESH_TOKEN,EVROC_PROJECT,EVROC_REGION, and so on) - The evroc CLI config file at
~/.evroc/config.yaml
If you've run evroc login, no further configuration is needed — an empty provider "evroc" {} block is enough. For CI pipelines, you typically set environment variables or use a service account with EVROC_USERNAME and EVROC_PASSWORD.
Prerequisites
To use the Terraform provider, you need:
- Terraform 1.0+ or OpenTofu 1.9+
- An evroc account with at least one project
- Credentials — either from the evroc CLI (
evroc login) or a service account
Learn more
- evroc Terraform provider on GitHub - Source code, examples, and resource reference
- Install the evroc CLI - The CLI shares credentials with the provider
- evroc Go SDK - The provider is built on top of the Go SDK; reach for it when you need imperative control that doesn't fit a declarative model
- Terraform documentation - Learn Terraform fundamentals