../_images/login_button.png ../_images/signup_button.png

Scalr Terraform Provider

(Version rc9)


The Scalr Terraform provider can be used to manage the components within Scalr IaCP. This will allow you to automate the creation of workspaces, variables, VCS providers and much more.


To start, an API token must be generated by clicking on your user on the top right of the screen and click on “TF API Access”:


This will provide you with an ID and token. The token will disappear after you click close. A user can have as many tokens as they want, it is up to that user to manage the tokens.

The token should then be used within the provider itself:

provider scalr {
  hostname = var.hostname
  token    = var.api_token

You can also add the token to your Terraform configuration file and the Scalr provider will use it automatically based on the hostname.


File name and location


file must be named named terraform.rc and placed in the relevant user’s %APPDATA% directory. The physical location of this directory depends on your Windows version and system configuration; use $env:APPDATA in PowerShell to find its location on your system.

All other


provider scalr {
  hostname = var.hostname

Authentication with Shell Variables

The Scalr provider accepts the hostname and token values through shell variables SCALR_HOSTNAME and SCALR_TOKEN.

These variables can be set in your local shell, e.g.

export SCALR_HOSTNAME="my-account.scalr.io"
export SCALR_TOKEN="xxxxxxxxxxxxxxxxxx"

They can also be set in the variables tab of a Scalr workspace.


The provider block will not require any parameters.

provider scalr {}

Scalr Provider Installation


This a 3rd party provider which cannot be automatically downloaded by Terraform. This provider must be installed manually.

The locations for installing the provider plugins depend on the version of Terraform in use. This tables specifies the installation locations for the specific versions of Terraform.


User Level Plugins

Workspace Plugins







The provider executables can be found here: https://github.com/Scalr/terraform-provider-scalr/releases

If you required detailed instructions for installing the provider please follow the link that is applicable to your version of Terraform.


Here is a basic example of creating a workspace with the provider:

provider scalr {
  hostname = var.hostname
  token    = var.api_token

resource scalr_workspace test {
  name         = "my-workspace-name"
  environment_id  = "env-xxxxxxxxx"
  auto_apply = "true"
  terraform_version = "0.12.19"
  vcs_provider_id = "my_vcs_provider"
  vcs_repo {
      identifier = "repo_org/repo_name"

Please see the full details for all of the resources in the list below.