variable "environment" {
  description = "Environment, e.g. dev, qa, prod"
}

variable "service_name" {
  description = "Name of service"
}

variable "access_log_type" {
  description = "Type of access logs being configured. At present, valid options are elb, s3, and cloudfront"
  default     = "cloudfront"
}

variable "application_family" {
  default = "security-tools"
}

variable "custom_access_logging_bucket" {
  description = "Custom bucket for S3 access logs. Overrides programmtically derived name."
  type        = string
  default     = ""
}

variable "custom_access_logging_prefix" {
  description = "Custom prefix for S3 access logs. Overrides programmtically derived name."
  type        = string
  default     = null
}

variable "kms_override_policy_documents" {
  description = "Override policy documents for the access logs KMS key policy"
  type        = list(string)
  default     = []
}

variable "bucket_policy_overrides" {
  description = "List of IAM policy document JSONs to merge with bucket policy. Statements with the same SID will be overridden."
  type        = list(string)
  default     = []
}

variable "sns_override_policy_documents" {
  description = "List of IAM policy document JSONs to merge with sns policy. Statements with the same SID will be overridden."
  type        = list(string)
  default     = []
}

variable "acl_policy_grants" {
  description = "List of maps containing ACL policies."
  type = list(object({
    id         = string
    type       = string
    permission = string
  }))
  default = []
}

variable "lifecycle_rules_options_noncurrent_version_transition" {
  type = list(object({
    prefix        = string
    enabled       = bool
    days          = number
    storage_class = string
  }))
  default = [
  ]
}

variable "lifecycle_rules_options_current_version_transition" {
  type = list(object({
    prefix        = string
    enabled       = bool
    days          = number
    storage_class = string
  }))
  default = [
  ]
}

variable "apply_replication_destination_configuration" {
  description = "List of maps containing replication configuration as a destination bucket."
  type = list(object({
    replication_source_iam_role_arn = string
    grant_kms_access                = optional(bool, false)
  }))
  default = []
}

variable "s3_bucket_notification_sns_events" {
  type        = list(string)
  description = "List of events which trigger messages to the SNS topic"
  default     = ["s3:ObjectCreated:*"]
}

variable "regional_postfix" {
  type        = string
  description = "Postfix to add to the bucket name."
  default     = ""
}

variable "custom_sqs_queue_arn" {
  type        = string
  description = "SQS endpoint to send messages to used instead of a standard one. SQS resources won't be created if this parameter is set."
  default     = ""
}

variable "allowed_sns_topic_arns" {
  type        = list(string)
  description = "List of ARNs of additional SNS topics which will be allowed to send messaged to the default SQS queue"
  default     = []
}
