locals {
  region = "us-east-1"

  owner        = "dejo"
  env          = "dev"
  maintainer   = "dejo"
  app          = "dejo-node"
  tier         = "backend"
  base_name    = "${local.env}-${local.maintainer}-${local.app}"
  kms_key_name = "alias/${local.base_name}-terraform-bucket-key"

  eks = {
    # After change cluster_name, change the the secret: DEV_DEJO_KUBE_CONFIG_DATA 
    # The value is a base64 from kubeconfig, example: cat ~/.kubeconfig | base64 -w 0
    cluster_name = "dev-dejo"
    lb_name      = "a7d3a64e7cd704e17a87740e579df9bc"

    namespace            = "dejo-node"
    service_account_name = "api-app-sa"
  }

  s3 = {
    bucket = "${local.owner}-${local.env}-${local.app}-permanent-storage"
    acl    = "private"

    versioning = {
      enabled = true
    }
  }

  #  event_bus = {
  #    name = "dev-dejo-event-bus"
  #  }

  custom_tags = {
    App  = upper(local.app)
    Tier = title(local.tier)
  }

  default_tags = {
    Owner      = title(local.owner)
    Env        = title(local.env)
    Maintainer = title(local.maintainer)
    ManagedBy  = "Terraform"
    BaseName   = local.base_name
    App        = "${local.maintainer}-${local.app}"
  }
}
