locals {
  tags = {
    application_family = var.application_family
    environment        = var.environment
    service_name       = var.service_name
    terraformed        = true
  }
  create_user_lambda_name  = "lambda-altafonte-create-user"
  send_success_lambda_name = "lambda-altafonte-send-success"
  send_failure_lambda_name = "lambda-altafonte-send-failure"
}

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

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

variable "service_name" {
  default = "altafonte-user-creation"
}

variable "bucket_name" {
  description = "Name of the S3 bucket.  Not confusing at all."
  default     = "altafonte-user-ingestion"
}

variable "application_family" {
  description = "Application family of which this is a component. Used for tagging"
  default     = "user-platform"
}

variable "slack_alert_channel" {
  default = "@slack-accounts-team-alerts"
}

variable "lambda_retry_attempts" {
  description = "Default value for number of retries"
  default     = 4
}

variable "lambda_interval_seconds" {
  description = "Default value for interval retry attempts"
  default     = 120
}

variable "lambda_concurrent_executions" {
  description = "Number of reserved concurrent executions for lambda function"
  default     = 20
}

variable "lambda_memory_size" {
  description = "Memory size for the lambda function"
  default     = 512
}

variable "lambda_default_timeout" {
  description = "Default value for timeout"
  default     = 300
}

variable "tolerated_failure_percentage" {
  description = "Percentage of tolerated failures before execution stops"
  default     = 100
}

variable success_kafka_topic {
  description = "Kafka topic for success messages"
  default     = "event.altafonteUserCreation"
}

variable failure_kafka_topic {
  description = "Kafka topic for failure messages"
  default     = "dlq.altafonteUserCreation"
}

variable max_concurrency {
  description = "Maximum number of concurrent executions for the state machine"
  # Being cautious about avoiding lock issues, though we've been okay.
  # lambda_concurrent_executions variable should >= this value.
  default     = 20
}
