variable "region" {
  default = "us-east-1"
}

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

variable "team_name" {
  type    = string
  default = "insights"
}

variable "read_capacity" {
  default     = "10"
  description = "Read capacity required by AWS for provisioning."
}

variable "write_capacity" {
  default     = "10"
  description = "Read capacity required by AWS for provisioning."
}

variable "hash_key" {
  default     = "first_id"
  description = "Hash key required by AWS for indexing."
}

variable "range_key" {
  default     = "second_id"
  description = "Range key required by AWS for secondary indexing."
}

variable "range_type" {
  default     = "S"
  description = "Type of range key."
}

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

variable "SENTRY_DSN" {
  default = ""
}

variable "LOGGER_DSN" {
  default = ""
}

variable "LOGGER_LEVEL" {
  default = "ERROR"
}

variable "REDIS_URL" {
  default = ""
}

variable "REDIS_CACHE_TTL" {
  description = "TTL in seconds"
  default     = 300
}

variable "DATADOG_ENV" {
  default = "prod-ows-analytics"
}

variable "DD_APM_ANALYZED_SPANS" {
  default = "flask|flask.request=1,requests|requests.request=1"
}

variable "SPLITIO_ENABLED" {
  default = ""
}

variable "iam_policy_arn" {
  description = "IAM Policy to be attached to user"
  type        = list(string)
  default = [
    "arn:aws:iam::437795906767:policy/Dynamo-prod-mobile_metadata-RW",
    "arn:aws:iam::437795906767:policy/Dynamo-prod-bff-mobile-owsrequest",
    "arn:aws:iam::437795906767:policy/SecretsManager-prod-datadog-policy",
    "arn:aws:iam::437795906767:policy/Dynamo-prod-ows-analytics-owsrequest",
    "arn:aws:iam::437795906767:policy/SecretsManager-prod-bff-mobile-policy",
    "arn:aws:iam::437795906767:policy/SecretsManager-prod-ows-analytics-policy",
    "arn:aws:iam::437795906767:policy/Dynamo-prod_analytics_metadata-RO"
  ]
}


variable "attributes" {
  type = list(object({
    name = string
    type = string
    }
  ))
  description = "List of additional attributes"
  default = [
    {
      name = "first_id"
      type = "S"
    },
    {
      name = "second_id"
      type = "S"
    }
  ]
}

variable "secondary_indices" {
  type = list(object({
    name            = string
    hash_key        = string
    range_key       = string
    projection_type = string
    read_capacity   = string
    write_capacity  = string
    }
  ))
  description = "List of global global_secondary_index"
  default = [
    {
      name            = "second_id-first_id"
      hash_key        = "second_id"
      range_key       = "first_id"
      projection_type = "ALL"
      read_capacity   = "5"
      write_capacity  = "5"
    }
  ]
}

variable "application_family" {
  default = "insights"
}

variable "snowflake_ows_podcast_db_schema" {
  default     = "ORCHARD_APP_REPORTING_V2.PROD_OWS_PODCAST_OWS_PODCAST."
  description = "Concatenated db and schema name of backup ows-podcast tables in snowflake"
}

variable "notification_endpoints" {
  default = "@slack-graphql @slack-insights-monitoring-alerts"
}

variable "teams" {
  description = "A set of Datadog Teams to associate the resources with"
  default     = ["insights"]
}

variable "splitio_preforked" {
  default = "false"
}

variable "secrets_manager_legacy_secret_names" {
  description = "List of secrets manager secrets to create"
  type        = list(string)
  default = [
    "APPLE_MUSIC_PRIVATE_KEY",
    "SNOWFLAKE_PRIVATE_KEY"
  ]
}

variable "secrets_manager_secret_names" {
  description = "List of secrets manager secrets to create"
  type        = list(string)
  default = [
    "SENTRY_DSN",
    "SNOWFLAKE_ROLE",
    "SNOWFLAKE_USER",
    "SNOWFLAKE_SCHEMA",
    "SNOWFLAKE_PASSWORD",
    "REDIS_PORT",
    "SNOWFLAKE_ACCOUNT",
    "SNOWFLAKE_WAREHOUSE",
    "REDIS_HOST",
    "SNOWFLAKE_DATABASE",
    "SNOWFLAKE_APOLLO_DATABASE",
    "SNOWFLAKE_APOLLO_SCHEMA",
    "SNOWFLAKE_PRIVATE_KEY",
  ]
}

variable "dependent_applications" {
  description = "List of dependent applications"
  type        = list(string)
  default     = ["insights", "workstation", "podcast"]
}
