Skip to main content
The Nscale Terraform provider lets you define and provision Nscale infrastructure as code. Declare your resources in .tf files, run terraform plan to preview changes, and terraform apply to create them. Use it for repeatable, version-controlled provisioning of VPCs, instances, clusters, security groups, and filesystems.
Prerequisite: You need a service token to authenticate the Terraform provider.

Quick Start

The provider is distributed via the Terraform Registry as nscaledev/nscale. Declare it in your required_providers block:
terraform {
  required_providers {
    nscale = {
      source = "nscaledev/nscale"
      # Check the Terraform Registry or GitHub Releases for the latest version.
      # version = "~> 0.0.8"
    }
  }
}
Pin your provider version in production to avoid unexpected changes when new versions are released. Use version = "~> 0.0.8" (or your current version) in the required_providers block.

Authentication

The provider authenticates with Nscale using a service token, which you can generate and rotate in the Nscale Console.

Environment Variables

The recommended way to configure the provider is via environment variables. This avoids hard-coding credentials in your .tf files:
export NSCALE_REGION_ID="<your-region-id>"
export NSCALE_ORGANIZATION_ID="<your-organization-id>"
export NSCALE_PROJECT_ID="<your-project-id>"
export NSCALE_SERVICE_TOKEN="<your-service-token>"
Alternatively, you can configure the provider block directly (not recommended for production):
provider "nscale" {
  # Recommended: supply these values via environment variables, not hard-coded here.

  # region_id       = "<your-region-id>"
  # organization_id = "<your-organization-id>"
  # project_id      = "<your-project-id>"
  # service_token   = "<your-service-token>"
}

Supported Resources

The following table maps Terraform resource types to their corresponding console pages:
Terraform ResourceDescriptionConsole Page
nscale_networkVPC networksVPC Networks
nscale_security_groupFirewall rulesSecurity Groups
nscale_file_storageShared NFS filesystemFilesystem
nscale_compute_instanceVirtual machinesInstances
nscale_compute_clusterGPU clustersClusters
More resources are planned for future releases.
terraform destroy deletes real infrastructure. Always review the plan output before confirming a destroy operation. Resources deleted via Terraform are permanently removed just as if you deleted them in the console.

Documentation

Full documentation for the provider is available on the Terraform Registry, and you can find examples in the GitHub repository.

Service Tokens

Generate the token used to authenticate the Terraform provider

API Reference

The underlying API that the Terraform provider calls

Terraform Registry

Full provider documentation and resource reference

GitHub Examples

Example Terraform configurations