variable aws_region {
  default     = "us-east-1"
  description = "AWS region"
}

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

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

variable "service_name" {
  default = "gda-signup-api"
}

variable lambda_name {
  default = "lambda-gda-signup"
}

variable lambda_handler {
  default = "src.app.handler"
}

variable "lambda_provisioned_concurrent_executions" {
  default = 3
}

variable "vpc_id" {
  description = "Default vpc id"
  default     = "vpc-7f0e841a"
}

variable vpc_subnet_ids {
  type        = list
  description = "VPC subnet IDs where the lambdas will execute"
  default     = ["subnet-cb4dbae0", "subnet-5366ef24", "subnet-043d235081c966332"]
}

variable msk_cluster_name {
  description = "MSK cluster name to read from."
  default     = "prod-managed-kafka-artist-diy"
}

variable kafka_topic {
  description = "Kafka topic to send messages to."
  default     = "event.gdaSubmitApplication"
}

variable salesforce_record_type_id {
  description = "Salesforce record type id"
  default     = "0124W0000007nnYQAQ"
}

variable datadog_advanced_enabled {
  description = "Enabled DataDog monitoring."
  default     = true
}

variable auth0_authorizer_issuer {
  description = "Auth0 tenant URL"
  default     = "https://workstation.auth0.com/"
}

variable auth0_authorizer_audience {
  description = "Auth0 audience"
  default     = "https://prod-gda-gateway-auth0-jwt-authorizer"
}

variable domain_name {
  description = "Domain name for the API Gateway"
  default     = "gda-gateway.theorchard.io"
}

variable acm_certificate_domain {
  description = "ACM certificate domain for the API Gateway"
  default     = "*.theorchard.io"
}

variable route53_zone_name {
  description = "Route53 zone name for the API Gateway domain"
  default     = "theorchard.io"
}

variable dlq_enabled {
  description = "Enable lambda DLQ"
  default     = true
}

variable api_gateway_access_logs_enabled {
  description = "Enable API Gateway access logs."
  default     = true
}


variable datadog_function_destination_lambda_name {
  description = "Name of datadog function for shipping cloudwatch logs"
  default     = "DatadogLambdaFunction"
}

variable "datadog_p90_monitor_threshold" {
  description = "DataDog Api Gateway p90 latency monitor threshold"
  default     = "6000"
}

variable "datadog_log_monitor_threshold" {
  description = "DataDog Api Gateway 401 log monitor threshold"
  default     = "12"
}

variable "datadog_error_monitor_threshold" {
  description = "DataDog Api Gateway error rate monitor threshold"
  default     = "1"
}

variable "datadog_notification_endpoints" {
  description = "DataDog notification endpoints"
  default     = "@slack-accounts-team-alerts"
}

locals {
  datadog_function_destination_arn = "arn:aws:lambda:${var.aws_region}:${data.aws_caller_identity.current.account_id}:function:${var.datadog_function_destination_lambda_name}"
}
