Terraform Provider

Explore the Cloudback Terraform Provider, an Infrastructure as Code (IaC) tool that enables automated management of backup configurations through Terraform.

The Cloudback Terraform Provider (terraform-provider-cloudback) is an Infrastructure as Code (IaC) tool that enables automated management of Cloudback backup configurations through Terraform.

Overview

This provider allows users to manage GitHub repository backup definitions using Cloudback's Operations API through Terraform configurations. It provides a seamless integration between Terraform and the Cloudback platform.

Features

  • Automated backup definition configuration for repositories

  • Infrastructure as Code approach to backup management

  • Support for Terraform-based workflow automation

Prerequisites

Before you begin, ensure that you have the following:

  • Terraform Installed: Version 1.0 or later is recommended.

  • Cloudback Account: An active account with appropriate permissions to create and manage backup resources.

  • API Key: Your API key for Cloudback’s API. You can create one at the API Keys page in the Cloudback dashboard.

  • Network Access: Ensure that your environment can reach Cloudback’s endpoints: https://app.cloudback.it/api/ops/

Usage

Provider Configuration

terraform {
  required_providers {
    cloudback = {
      source = "cloudback/cloudback"
    }
  }
}

provider "cloudback" {
  api_key = "your-api-key" # Replace with your API key, see https://app.cloudback.it/apikeys
}

Note: You can provide your API key either directly in the configuration or through the CLOUDBACK_API_KEY environment variable:

export CLOUDBACK_API_KEY="your-api-key"

Resource: Backup Definition

Backup definitions are the primary resources managed by the Cloudback. They represent the configuration for a specific repository.

resource "cloudback_backup_definition" "demo" {
  platform = "GitHub"
  account = "cloudback"
  repository = "demo-repository"
  settings = {
    enabled = true
    schedule = "Daily at 9 pm"
    storage = "Cloudback EU"
    retention = "Last 30 days"
  }
}

Attributes:

  • platform: The platform of the repository (e.g., GitHub, GitLab, Bitbucket). Mandatory.

  • account: The account name of the repository. Mandatory.

  • repository: The repository name. Mandatory.

  • settings: The backup configuration settings. Mandatory.

    • enabled: Whether the automated scheduled backup is enabled, true or false. Optional.

    • schedule: The schedule for the automated backup. Complete list of supported schedules can be found here. Optional.

    • storage: The storage location for the backup. Complete list of supported storages can be found here. Optional.

    • retention: The retention policy for the backup. Possible options are Last 30 days, Last 90 days, Last 180 days, Last 360 days. Optional.

Documentation

For detailed documentation and examples, visit the official repository.

References

Last updated

Was this helpful?