Experts insights Updates and releases

First published release of the community Terraform Gandi provider (v2.0.0)

A visual representation of a server stack with a laptop next to it on a navy blue background. The words "GandiCloud VPS" are superimposed over the entire image

The go-gandi community released and published the Gandi Terraform provider (v2.0.0) on the Terraform registry. This Terraform provider lets you declaratively manage several Gandi products, such as domain, email, livedns, and web hosting.

New feature: Terraform Gandi provider

Terraform helps you manage hundreds of Cloud resources defined with declarative configuration files. Thanks to the Gandi Terraform provider, you can manage several Gandi products, such as domain, email, livedns, and web hosting.

This provider was created by Sébastien Maccagnoni and co-developped by 16 contributors in about 200 commits under a MPL-2.0 license.

We want to thank all of these contributors for the hard work they achieved.

A simple example: how to add a record on the domain example.com?

Suppose we want to add a new record on the existing domain example.com. Let’s create a main.tf file with the following content:

    terraform {
      required_providers {
        gandi = {
          version = "~> 2.0.0"
          source   = "go-gandi/gandi"
        }
      }
    }

    resource "gandi_livedns_record" "example_com" {
      zone = "example.com"
      name = "www"
      type = "A"
      ttl = 3600
      values = ["192.168.0.1"]
    }


The record can then be managed (created, updated, and deleted) declaratively by Terraform:

        terraform apply main.tf

This command shows which resources will be modified and if we accept the modification, Terraform will modify the zone of the domain name example.com through our public API. Later, we could modify the main.tf file and rerun the Terraform apply command to update the zone.

For more information about supported Gandi resources, please refer to the full provider documentation.

Our VPS server, based on OpenStack, can also be managed using Terraform. The OpenStack and Gandi Terraform providers can be used together to deploy your whole infrastructure, from domain names to servers.

Discover other amazing community projects around Gandi and share yours! 

What’s a Terraform provider?

Terraform is an infrastructure as code tool. It enables users to interact with hundreds of Cloud resources through Terraform providers. A Terraform provider is a kind of plugin allowing Terraform to manage specific resources through vendor public APIs.