locals {
  env = {
    default = {
      service_name = "banner-service"
      container_port = 9099
      env_account = terraform.workspace
      region = "us-east-1"
      health_check_path = "/actuator/health"
      iam_suffix = ""
      rds_pool_size = 10
    }

    nf-sandbox = {
      subdomain = "sandbox.netfoundry.io"
      deploy_env_name = "sandbox"
      spring_config_label = "develop"
      task_count = 1
      role_arn = "arn:aws:iam::721086286010:role/ops-mgmt-admin"
    }

    nf-staging-int = {
      subdomain = "staging.netfoundry.io"
      deploy_env_name = "staging"
      spring_config_label = "staging"
      task_count = 1
      role_arn = "arn:aws:iam::560269805515:role/ops-mgmt-admin"
    }

    nf-prod-int = {
      subdomain = "production.netfoundry.io"
      deploy_env_name = "production"
      spring_config_label = "production"
      task_count = 2
      role_arn = "arn:aws:iam::745435643501:role/ops-mgmt-admin"
    }
  }

  environmentvars = contains(keys(local.env), terraform.workspace) ? terraform.workspace : "default"
  workspace       = merge(local.env["default"], local.env[local.environmentvars])

  cost_bucket_tags = {
    cost_environment = local.workspace["deploy_env_name"] == "production" ? "production" : "non-production"
    cost_team_owner  = "MOPPLT"
    cost_category    = "MOPINT"
    nf_node_type     = "MOP"
  }
}