Skip to content

Get Started

Terraform is an open-source infrastructure as code tool that allows you to define and manage your infrastructure resources in a declarative way. This guide will help you get started with using the Quant Terraform provider to manage your QuantCDN resources.

Prerequisites

  1. Install Terraform (version 0.12.x or later)
  2. Have a QuantCDN account and API credentials

Installation

  1. Install Terraform by following the official Install Terraform guide.

  2. Create a new directory for your Terraform configuration:

    Terminal window
    mkdir quant-terraform-project
    cd quant-terraform-project
  3. Create a main.tf file in this directory to define your Terraform configuration.

Configuration

  1. In your main.tf file, add the Quant provider block:

    terraform {
    required_providers {
    quant = {
    source = "quantcdn/quant"
    version = "~> 1.0" # Replace with the latest version
    }
    }
    }
    provider "quant" {
    bearer = "your_api_key_here"
    organization = "your_organization_id_here"
    # Add any other necessary provider configurations
    }
  2. Replace "your_api_key_here" with your actual QuantCDN API key.

  3. Replace "your_organization_id_here" with your actual QuantCDN organization ID.

Define Resources

Now you can start defining QuantCDN resources in your main.tf file. For example, to create a new project:

resource "quant_project" "example" {
name = "example"
description = "An example project"
}

Initialize and Apply

  1. Initialize the Terraform working directory:
Terminal window
terraform init
  1. Review the planned changes:
Terminal window
terraform plan
  1. Apply the configuration:
Terminal window
terraform apply

Next Steps