variable "account_group" {
  description = "The name of the account group that the account belongs to"
  default     = "permissions-platform"
}

variable "aws_region" {
  default     = "us-east-1"
  description = "Which AWS region to spin up the environment in"
}

variable "cache_use_redis" {
  description = "Flag to enable redis caching"
  default     = "True"
}

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

variable "domain_name" {
  description = "Name of domain"
  default     = "prod-permissions-platform.theorchard.io"
}

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

variable "service_name" {
  default = "ows-pdp"
}

variable "dynamo_table_identity" {
  description = "Name of pp_identity dynamodb table"
  default     = "prod_pp_identity"
}

variable "dynamodb_tcp_keep_alive" {
  description = "Enables the TCP Keep-Alive socket option for dynamodb connections"
  default     = "False"
}

variable "jwt_auth_enabled" {
  description = "Whether JWT is enabled -- it should always be"
  default     = true
}

variable "auth_issuers" {
  type        = map(string)
  description = "Issuer of the JWT, follows the type defined in terraform-fargate."
  default = {
    # Overrides the default behavior that allows the qa issuer as "https://qalogin.theorchard.com/, https://qa-orchard.auth0.com/"
    prod = "https://workstation.auth0.com/"
  }
}

variable "the_orchard_api_audience" {
  description = "Application audience for which the JWT is intended."
  default     = "https://prod-ows.theorchard.io"
}

variable "redis_cache_ttl_seconds" {
  description = "Redis cache key expiration time in seconds."
  default     = "300"
}

variable "m2m_api_audience" {
  description = "API audience for which the JWT is intended"
  default     = "https://workstation.theorchard.com/api"
}

variable "splitio_impressions_mode" {
  description = "Defines how impressions are queued on splitio-python SDK."
  default     = "optimized"
}

variable "splitio_preforked_init" {
  description = "Flag for enabling fork execution in preforked-type servers such as uWSGI or GUnicorn"
  default     = "False"
}

variable "cerbos_batch_size" {
  description = "Request size for cerbos resource check"
  default     = 10
}

variable "cerbos_request_retries" {
  description = "Maximum number of cerbos request retries."
  default     = "0"
}

variable "dd_profiling_enabled" {
  type        = bool
  description = "Whether Datadog continuous profiling is enabled"
  default     = true
}

# Identity data changes infrequently; 3-day cache reduces load on
# `POST /self/allowed-tenants/` while maintaining reasonable freshness
# (see PP-1455)
variable "cache_ttl_seconds_identity_allowed_tenants" {
  type        = number
  description = "Redis cache key expiration for allowed-tenants entries in seconds"
  default     = 259200
}

# Identity data changes infrequently; 3-day cache reduces load on
# `GET /self/roles/` while maintaining reasonable freshness (see PP-1455)
variable "cache_ttl_seconds_identity_tenant_roles" {
  type        = number
  description = "Redis cache key expiration for tenant-roles entries in seconds"
  default     = 259200
}

variable "team_name" {
  description = "Team responsible for this service"
  type        = string
  default     = "permissions-platform"
}
