Skip to content

Commit

Permalink
feat: add new type of log_drains and validate input
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpage committed Sep 15, 2023
1 parent f4f1765 commit 19f4e22
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,23 @@ variable "domain_aliases" {

variable "log_drains" {
type = list(object({
type = string
url = optional(string, "")
type = string
url = optional(string, "")
drain_region = optional(string, "")
addon = optional(string, "")
host = optional(string, "")
port = optional(string, "")
token = optional(string, "")

}))
default = []
nullable = false

validation {
condition = length([
for drain in var.log_drains :
drain if !contains(["elk", "appsignal", "logtail", "datadog", "ovh-graylog", "papertrail", "logtail", "syslog"], drain.type)
]) == 0
error_message = "The list of log drains must contain only valid log drains type (elk/appsignal/logtail/datadog/ovh-graylog/papertrail/logtail/syslog)."
}
}

0 comments on commit 19f4e22

Please sign in to comment.