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

variable "team_security_notification_rules" {
  description = "List of security notification rules to be created"
  type = map(object({
    name                 = optional(string, "") # Override the default name. Defaults to '[TEAM] Security Notifications Rule'.
    enabled              = optional(bool, true) # Whether the notification rule is enabled.
    time_aggregation     = optional(number, 86400) # Time aggregation window in seconds for grouping findings into a single notification. Defaults to 24 hours.
    team_notification    = optional(bool, true) # Whether to send notifications to the team target. Defaults to true.
    slack_channel        = optional(string, "") # Slack channel to send notifications to.
    jira_project         = optional(string, "") # Required if "jira" is included in notification_targets, must be pre-configured in Datadog. https://sonymusic-pde.datadoghq.com/integrations?search=jira&integrationId=jira
    filters              = optional(set(string), []) # A list of additional query filters (e.g., ['env:prod']). These will be joined with AND logic.
    severities           = optional(set(string), ["critical", "high"]) # Severities to include in the notification. Defaults to ["critical", "high"].
  }))
  default = {
    "osp" = {
      jira_project = "OSP"
      filters = [
        "-repository_url:github.com/theorchard/graphql-gateway",
        "-type:\"Risky license\""
      ]
    }
  }
}
