Custom Providers

Don't see a provider that you use listed in Scalr? Maybe you want to use the Datadog provider to create a dashboard or the GitHub provider to create a new repo. This is where custom providers come into play. The custom providers functionality gives you the ability to use any Terraform or OpenTofu provider by adding arguments for each credential field needed by the provider.

First, add the name and provider name for the configuration. Once saved, you will be prompted to add the parameters needed for authentication:

1212

The provider configuration will automatically be injected into the run once it is shared with an environment.

Here is an example using the Scalr provider to manage a Kubernetes provider configuration:

resource "scalr_provider_configuration" "kubernetes" {
  name            = "k8s"
  account_id      = "acc-xxxxxxxxx"
  custom {
    provider_name = "kubernetes"
    argument {
      name        = "host"
      value       = "my-host"
      description = "The hostname (in form of URI) of the Kubernetes API."
    }
    argument {
      name        = "username"
      value       = "my-username"
    }
    argument {
      name        = "password"
      value       = "my-password"
      sensitive   = true
    }
  }
}

The above is an example, please see the full provider documentation here.

Nested Parameters

Scalr does not currently support providers that require nested parameters for authentication. For example, the GitHub App uses nest parameters which will not work:

provider "github" {
  owner = "johnsmith"
  app_auth {
    id              = 111111
    installation_id = 2222222
    pem_file        = "-----BEGIN RSA PRIVATE KEY----- ..... "
  }
}

In this case, the personal access token authentication can be used as nested parameters are not necessary:

provider "github" {
  token = var.token # or `GITHUB_TOKEN`
}

We are working on the support of nested parameters in provider configurations.