Skip to content

Commit 9d46d7f

Browse files
authored
fix: add validation to ensure cloud monitoring agent tags have no spaces (#405)
1 parent 92f19d3 commit 9d46d7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ variable "cloud_monitoring_agent_tags" {
181181
description = "List of tags to associate to all matrics that the agent collects. NOTE: Use the 'cloud_monitoring_add_cluster_name' variable to add the cluster name as a tag."
182182
default = []
183183
nullable = false
184+
185+
validation {
186+
condition = alltrue([for tags in var.cloud_monitoring_agent_tags : !can(regex("\\s", tags))])
187+
error_message = "The cloud monitoring agent tags must not contain any spaces."
188+
}
184189
}
185190

186191
variable "cloud_monitoring_add_cluster_name" {

0 commit comments

Comments
 (0)