fly-apps / terraform-provider-fly

Terraform provider for the Fly.io API
BSD 3-Clause "New" or "Revised" License
114 stars 38 forks source link

Require `services` property on `fly_machine` #169

Open oscarhermoso opened 1 year ago

oscarhermoso commented 1 year ago

Currently, you can deploy a fly_machine without any services:

resource "fly_machine" "app" {
  cpus     = 1
  memorymb = 256

  app    = fly_app.app.name
  region = var.region
  name   = "${fly_app.app.name}-${var.region}"
  image  = var.image
  env    = var.env

  # services = var.services # <-- missing
}

Although most people would not make this mistake, it became an issue when I was extracting a module for our app

Ideally it would be a required field, possibly allowing an empty list, unless there is some reason for it to be optional that I have not considered.