variable "kubeconfig_path" {
  type = string
}

variable "env" {
  type = string
}

variable "name" {
  type = string
}

variable "cluster" {
  type = string
}

variable "endpoint" {
  type = string
}

variable "subscription_id" {
  type = string
}

variable "tenant_id" {
  type = string
}

variable "client_id" {
  type = string
}

variable "token_file_path" {
  type = string
}

module "jumpserver" {
  source = "../../../modules/app"

  kubeconfig_path = var.kubeconfig_path
  workflow        = "new-jump-server-dst.yaml"
  parameters = {
    env  = var.env
    name = var.name
    destination = templatefile("${path.module}/jumpserver_destination.yml.tpl", {
      name            = var.name
      cluster         = var.cluster
      endpoint        = var.endpoint
      subscription_id = var.subscription_id
      tenant_id       = var.tenant_id
      client_id       = var.client_id
      token_file_path = var.token_file_path
    })
  }
  services = []
}

output "name" {
  value = var.name
}
