variable "application_family" {
  default = "permissions-platform"
}

variable "environment" {
  description = "Available values:  dev, qa, prod."
  default     = "qa"
}

variable "table_name" {
  description = "DynamoDB table name"
  default     = "pp_identity"
}

variable "hash_key" {
  description = "Name of primary key"
  default     = "identity_uuid"
}

variable "range_key" {
  description = "Name of the sort key"
  default     = "tenant_uuid"
}

variable "range_type" {
  description = "Sort key type: 'S' for String, 'B' for Boolean, 'N' for Numeric"
  default     = "S"
}

variable "range_key_enabled" {
  description = "Add a sort key? true or false"
  default     = true
}

variable "global_table_replica_regions" {
  description = "list of regions where global table should be in addition to main region"
  type        = list(string)
  default     = ["us-west-2"]
}


# GSI: Inverted index on tenant_uuid to identity_uuid
# The write_capacity and read_capacity fields are required by terraform-dynamodb
# but not used because this table uses ON-DEMAND capacity mode.
variable "global_secondary_index" {
  type = list(object({
    name            = string
    hash_key        = string
    range_key       = string
    projection_type = string
    }
  ))
  description = "List of GSIs for the table"
  default = [
    {
      name            = "tenant_uuid-identity_uuid"
      hash_key        = "tenant_uuid"
      range_key       = "identity_uuid"
      projection_type = "ALL"
    }
  ]
}

variable "ttl_enabled" {
  description = "Enable TTL for the table"
  default     = true
}

variable "ttl_attribute_name" {
  description = "Name of the attribute to use for TTL"
  default     = "expires_at"
}
