#-------------------------------
# KMS Key
#-------------------------------

resource "aws_kms_key" "vault" {
  description = "Vault unseal key"
  enable_key_rotation = true
  tags = {
    Name = "vault-kms-unseal-${var.environment}"
  }
}

resource "aws_kms_alias" "vault" {
  name          = "alias/vault-kms-unseal-${var.environment}"
  target_key_id = aws_kms_key.vault.key_id
}