Scalingo’s official release of a Terraform Provider

January 24, 2023 - 3 min read
Scalingo’s official release of a Terraform Provider

We are glad to announce Scalingo’s official Terraform Provider in its first stable version!

This provider allows users to easily leverage Terraform “Infrastructure as Code” paradigm to manage their Scalingo resources: allowing you to ease the evolution of your infrastructure and the track of changes among your applications and databases.

In this blog post, we'll go over some of the key features of the Scalingo Terraform provider, show you how to use the tool, and explain the benefits of using Terraform with Scalingo.

Key Features

The Scalingo Terraform provider includes support for many of the key Scalingo resources.

The vast majority of features which can be manipulated through our web dashboard or our command line interface can be managed directly by Terraform, a few examples:

  • Applications: their environment, collaborators and integration with GitHub/GitLab
  • Domains: definition and HTTPS configuration
  • Addons: databases and network, configuration and plan (upgrade/downgrade) management
  • Events Notifiers and Alerts

Getting Started

To get started with the Scalingo Terraform provider, you need to have Terraform installed on your machine. If you haven't used it before, you can install Terraform from here.

Once you have done the installation, you'll need to add the Scalingo provider to your Terraform configuration. First you need to declare it as dependency then, a provider block should be added, like this:

terraform {
  [...]
  required_providers {
    scalingo = {
      source  = "Scalingo/scalingo"
      version = "~> 1.0"
    }
    [...]

}

provider "scalingo" {
  api_token = "<Your Scalingo API Token>"
}

You'll need to replace <Your Scalingo API Token> with your Scalingo API token, which you can find in your Scalingo dashboard under "Account Settings".

With the provider configured, you can start using the Scalingo Terraform resources to manage your infrastructure. Here's an example of how you might use Terraform to create a new Scalingo application:

resource "scalingo_app" "my_app" {
  name = "my-app"
}

This code creates a new Scalingo application called "my-app". You can then use Terraform to add collaborators, databases, and other resources to your application.

Benefits of Using Terraform with Scalingo

Infrastructure as Code

One of the biggest benefits is the ability to manage your infrastructure as code. This means you can store your infrastructure configuration in version control, making it easy to track changes and roll back if necessary.

Having source code to define your infrastructure resources leads to less errors since code can be reviewed and Terraform allows you to preview changes before executing them.

Automation of Infrastructure Management

Another benefit is the ability to automate your infrastructure management. With Terraform, you can use a single command to create or update your entire Scalingo infrastructure, making it easy to automate common tasks. This can save you a lot of time and effort compared to managing your infrastructure by hand.

You can leverage this technology to easily create multiple development or staging environment of your applications and give the appropriate permissions to the right people from your team.

Using Terraform Ecosystem

Finally, using Terraform with Scalingo allows you to take advantage of the powerful Terraform ecosystem, including other providers from the Terraform module registry. This makes it easy to share and reuse your infrastructure configuration with others, and collaborate on infrastructure projects with your team.

For instance, you can create your Scalingo resources, then configure your domain DNS to target your applications (Cloudflare, Gandi, DNSimple providers) and finally automatically configure probes from the monitoring tool of your choice. All these actions can be performed in one single action.

In short

The Scalingo Terraform provider makes it easy to manage your Scalingo managed infrastructure using the familiar Terraform syntax and include the platform in your DevOps practices. If the amount of resources you’re manipulating is getting more and more numerous, you should really have a look at the official Terraform documentation of the provider and give it a try!

Share the article
Léo Unbekandt
Léo Unbekandt
Léo is the founder and CTO of Scalingo. He studied in France as a cloud engineer (ENSIIE) and in England (Cranfield University). He is in charge of Scalingo's technical development and he manages Scalingo's tech team.

Try Scalingo for free

30-day free trial / No credit card required / Hosted in Europe