resource "hcloud_floating_ip" "app" {
  name          = "${local.name_prefix}-app-fip"
  type          = "ipv4"
  home_location = var.location
  description   = "Floating IP for ${local.environment} app entry point"

  labels = {
    environment = local.environment
    role        = "app"
  }
}

resource "hcloud_floating_ip_assignment" "app" {
  floating_ip_id = hcloud_floating_ip.app.id
  server_id      = hcloud_server.app.id
}
