variable "buckets" {
  type        = list(object({ bucket = string, prefixes = optional(list(string), ["*"]) }))
  description = "List of objects which contain bucket name and list of allowed prefixes."
}

variable "action_types" {
  type        = list(string)
  description = "Which action types to allow. Potential values: read, write, delete."
  validation {
    condition     = length(setsubtract(toset(var.action_types), ["read", "write", "delete"])) == 0
    error_message = "Allowed actions are: read, write, delete."
  }
}

variable "enable_global_actions" {
  type        = bool
  description = "Enable global S3 actions like ListAllBuckets"
  default     = false
}
