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.
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:
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.
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.
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.
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.
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!
At Scalingo (with our partners) we use trackers on our website.
Some of those are mandatory for the use of our website and can't be refused.
Some others are used to measure our audience as well as to improve our relationship with you or to send you quality content and advertising.