#----------------------------------------------------------------------------
# Secrets Engines
#----------------------------------------------------------------------------

resource "vault_mount" "engineering" {
  path        = "engineering"
  type        = "kv-v2"
  description = "engineering"
}

resource "vault_mount" "ghe-deploy-keys" {
  path        = "ghe-deploy-keys"
  type        = "kv-v2"
  description = "ghe-deploy-keys"
}

resource "vault_mount" "jenkins" {
  path        = "jenkins"
  type        = "kv-v2"
  description = "jenkins"
}

resource "vault_mount" "onboarding" {
  path        = "onboarding"
  type        = "kv-v2"
  description = "onboarding"
}

resource "vault_mount" "onboarding-afs" {
  path        = "onboarding-afs"
  type        = "kv-v2"
  description = "onboarding-afs"
}

resource "vault_mount" "onboarding-gallery" {
  path        = "onboarding-gallery"
  type        = "kv-v2"
  description = "onboarding-gallery"
}

resource "vault_mount" "onboarding-saf" {
  path        = "onboarding-saf"
  type        = "kv-v2"
  description = "onboarding-saf"
}

resource "vault_mount" "portal" {
  path        = "portal"
  type        = "kv-v2"
  description = "portal"
}

resource "vault_mount" "phantom" {
  path        = "phantom"
  type        = "kv-v2"
  description = "phantom"
}

resource "vault_mount" "soc" {
  path        = "soc"
  type        = "kv-v2"
  description = "soc"
}

#salt supports kv
resource "vault_mount" "salt" {
  path        = "salt"
  type        = "kv"
  description = "salt"
}

#test secret
resource "vault_generic_secret" "test" {
  depends_on = [ vault_mount.salt ]
  path = "salt/pillar_data"

  data_json = <<EOT
{
  "my-pillar":   "my-secret"
}
EOT
}