The Terraform provider for Eon allows you to manage your cloud backup and restore infrastructure using Infrastructure as Code (IaC). Connect cloud accounts, manage backup policies, and orchestrate disaster recovery workflows with Terraform.
- Source Account Management: Connect and manage cloud accounts containing resources to be backed up
- Restore Account Management: Connect and manage cloud accounts where backups can be restored
- Backup Policy Management: Create, update, and manage backup policies with schedules, retention, and notifications
- Multi-Cloud Support: AWS, Azure, and GCP (AWS fully supported, Azure and GCP in development)
- Data Sources: Query existing source and restore accounts, backup policies, and snapshots
terraform {
required_providers {
eon = {
source = "eon-io/eon"
version = "~> 1.0"
}
}
}
- Download the latest release from the releases page
- Extract the binary to your Terraform plugins directory
- Run
terraform init
The provider supports authentication via OAuth2 client credentials. You can configure authentication in several ways:
export EON_ENDPOINT="https://your-eon-instance.eon.io"
export EON_CLIENT_ID="your-client-id"
export EON_CLIENT_SECRET="your-client-secret"
export EON_PROJECT_ID="your-project-id"
provider "eon" {
endpoint = "https://your-eon-instance.eon.io"
client_id = "your-client-id"
client_secret = "your-client-secret"
project_id = "your-project-id"
}
# Connect an AWS source account
resource "eon_source_account" "aws_production" {
name = "Production AWS Account"
cloud_provider = "AWS"
provider_account_id = "123456789012"
role = "arn:aws:iam::123456789012:role/EonBackupRole"
}
# Connect an AWS restore account
resource "eon_restore_account" "aws_disaster_recovery" {
name = "Disaster Recovery AWS Account"
cloud_provider = "AWS"
provider_account_id = "987654321098"
role = "arn:aws:iam::987654321098:role/EonRestoreRole"
}
# Create a backup policy
resource "eon_backup_policy" "all_resources" {
name = "All Resources Policy"
enabled = true
resource_selector = {
resource_selection_mode = "ALL"
}
backup_plan = {
backup_policy_type = "STANDARD"
standard_plan = {
backup_schedules = [
{
vault_id = "vault-all"
retention_days = 90
schedule_config = {
frequency = "DAILY"
daily_config = {
time_of_day_hour = 1
time_of_day_minutes = 0
start_window_minutes = 360
}
}
}
]
}
}
}
# List all source accounts
data "eon_source_accounts" "all" {}
# List all restore accounts
data "eon_restore_accounts" "all" {}
# List all backup policies
data "eon_backup_policies" "all" {}
output "source_account_count" {
value = length(data.eon_source_accounts.all.accounts)
}
output "backup_policy_count" {
value = length(data.eon_backup_policies.all.policies)
}
Manages source accounts for backup operations.
Arguments:
name
(Required) - Display name for the source accountcloud_provider
(Required) - Cloud provider (AWS, AZURE, GCP)provider_account_id
(Required) - Cloud provider account IDrole
(Required) - IAM role ARN (AWS), service principal (Azure), or service account email (GCP)
Attributes:
id
- Source account identifierstatus
- Connection statuscreated_at
- Creation timestampupdated_at
- Last update timestamp
Manages restore accounts for restore operations.
Arguments:
name
(Required) - Display name for the restore accountcloud_provider
(Required) - Cloud provider (AWS, AZURE, GCP)provider_account_id
(Required) - Cloud provider account IDrole
(Required) - IAM role ARN (AWS), service principal (Azure), or service account email (GCP)
Attributes:
id
- Restore account identifierstatus
- Connection statuscreated_at
- Creation timestampupdated_at
- Last update timestamp
Manages backup policies for automated backup operations.
Arguments:
name
(Required) - Display name for the backup policyenabled
(Required) - Whether the backup policy is enabledresource_selection_mode
(Required) - Resource selection mode: 'ALL', 'NONE', or 'CONDITIONAL'backup_policy_type
(Required) - Backup policy type: 'STANDARD', 'HIGH_FREQUENCY', or 'PITR'vault_id
(Required) - Vault ID to associate with the backup policyschedule_frequency
(Required) - Frequency for the backup scheduleretention_days
(Required) - Number of days to retain backupsresource_inclusion_override
(Optional) - List of resource IDs to include regardless of selection moderesource_exclusion_override
(Optional) - List of resource IDs to exclude regardless of selection mode
Attributes:
id
- Backup policy identifiercreated_at
- Creation timestampupdated_at
- Last update timestamp
Retrieves information about all source accounts.
Attributes:
accounts
- List of source account objects withid
,name
,provider
,provider_account_id
, andstatus
Retrieves information about all restore accounts.
Attributes:
accounts
- List of restore account objects withid
,provider
,provider_account_id
,status
, andregions
Retrieves information about all backup policies.
Attributes:
policies
- List of backup policy objects withid
,name
, andenabled