I am using map(object) for my terraform module to implement Kubernete cluster. The requirement is to use map(object) variable type.
This is the variable I am using:
variable "user_node_pool" {
type = map(object({
mode = string
vm_size = string
user_max_pods = number
user_os_size = number
node_os = string
user_auto_scaling = bool
user_min_count = number
user_max_count = number
}))
}
If I use below values as my input it works, but we don't want to pass values like this. We want to pass the values as a single line parameter:
user_node_pools = {
pool2 = {
mode = "User"
vm_size = "Standard_D2_v3"
user_max_pods = 110
user_os_size = 128
node_os = "Windows"
user_auto_scaling = true
user_min_count = 1
user_max_count = 1
} }
Unfortunately the requirement is to pass on this value as a single line parameter because of few environmental dependencies. Something like below, but this is failing because of "Missing newline after argument" error.
user_node_pools = "{"pool2" : { "mode" : "User", "vm_size" : "Standard_D2_v3", "user_max_pods" : 110, "user_os_size" : 128, "node_os" : "Windows", "user_auto_scaling" : "true", "user_min_count" : 1, "user_max_count" : 1}}"
I am getting below error while using this syntax:
My ask here is:
Please let me know how can I pass on the map(object) variable inputs as a single line. What is the correct syntax for that?