🎁 Try it for free - Get free credits instantly after registration!
  • Home
  • Blog
  • ServersCamp Terraform Provider is Now Available

ServersCamp Terraform Provider is Now Available


We’re excited to announce that the official ServersCamp Terraform provider is now published and available on the Terraform Registry.

With this provider, you can now define and manage your ServersCamp infrastructure as code — including servers, SSH keys, images, and more — directly from your Terraform configurations.

Why Terraform?

Terraform enables reproducible, version-controlled infrastructure. Combined with ServersCamp, it gives you a simple and powerful way to spin up virtual machines, manage access keys, and automate your workflows.

Quick Example

Here’s a simple configuration that:

  • Imports an SSH public key,
  • Looks up available flavors and images,
  • Creates a new server instance,
  • Outputs its assigned IPv4 and IPv6 addresses.
terraform {
  required_providers {
    scamp = {
      source  = "serverscamp/scamp"
      version = "0.1.3"
    }
  }
}

provider "scamp" {
  api_key = "<your_api_key_here>"
}

resource "scamp_ssh_key" "main_key" {
  name       = "main"
  public_key = file("~/.ssh/id_rsa.pub")
  protected  = false
}

data "scamp_flavors" "all_flavors" {}
data "scamp_images" "all_images" {}
data "scamp_limits" "all_limits" {}

locals {
  sc_mini_id = one([
    for f in data.scamp_flavors.all_flavors.items : f.id
    if f.name == "sc-mini"
  ])
  ubuntu24_id = one([
    for i in data.scamp_images.all_images.items : i.id
    if lower(i.distro_family) == "ubuntu" && startswith(i.version, "24")
  ])
}

resource "scamp_instance" "main_vm" {
  name    = "mainvm"
  flavor  = local.sc_mini_id
  image   = local.ubuntu24_id
  ssh_key = scamp_ssh_key.main_key.id
  running = true
  depends_on = [scamp_ssh_key.main_key]
}

output "main_ipv4" {
  value = scamp_instance.main_vm.ipv4
}

output "main_ipv6" {
  value = scamp_instance.main_vm.ipv6
}

Get Started