Just created Terraform provider for managing directus

Just created a terraform provider for managing configuration of directus.

It’s on very early stages, mostly written as PoC with chatgpt, but it’s already very usefull on our simple production project.

We will be happy to make things happen faster, so opening doors to everyone who is willing to contribute.

you can try to create policies and roles already with it

terraform {
   required_providers {
      directus = {
         source  = “soft-techies-com/directus”
         version = “0.1.4"
      }
   }
}


resource "directus_file" "logo" {
  type              = "image/png"
  title             = "logo"
  storage           = "local"
  filename_disk     = "logo.png"
  filename_download = "logo.png"
  metadata          = jsonencode({})
  filesize          = 6547
  width             = 256
  height            = 241
}

resource "directus_setting" "instance" {
  project_name                     = "Example"
  project_url                      = "http://example.com"
  public_note                      = "Example | Example Management Panel"
  project_logo                     = directus_file.logo.id
  project_color                    = "#FFFFFF"
  project_descriptor               = "Example Management Panel"
  public_favicon                   = directus_file.logo.id
  public_registration              = false
  public_registration_verify_email = true
  default_language                 = "en-US"
  accepted_terms                   = true
  auth_login_attempts              = 25
  default_appearance               = "auto"
  default_theme_light              = "Directus Default"
  storage_asset_transform          = "all"
}

Hey @abo, thanks for sharing this, since you’re not looking for help with this post I’m going to move it into the showcase section :slight_smile:.

When you were creating this with chatgpt, how did you find the prompting process and did you run into any learnings along the way?

Hi,
That was ease, I started do Directus configuration with API and simple bash scripts. However, for managing multiple projects it became overkill. So I decided to feed GPT with our scripts, request and response examples and tf provider example, the result was working from the first try, then needed just to fix some small bugs