There are number, bool, string, and list attributes, but the type is map, which can only contain values of a single type, so type checking prevents configuring custom_origin_config
example errors
With explicit tomap
Error: Invalid function argument
on main.tf line 131, in module "router":
131: custom_origin_config = tomap({
132: http_port = 80
133: https_port = 443
134: origin_protocol_policy = "https-only"
135: origin_ssl_protocols = ["my", "favorite", "protocols"]
136: origin_keepalive_timeout = 12345
137: origin_read_timeout = 12345
138: })
Invalid value for "v" parameter: cannot convert object to map of any single
type.
With {} syntax
he given value is not suitable for child module variable "custom_origins"
defined at .terraform/modules/router/variables.tf:322,1-26: element 0:
attribute "custom_origin_config": all map elements must have the same type.
…
81: custom_origin_config = {
82: http_port = 80
83: https_port = 443
84: origin_protocol_policy = "https-only"
85: origin_ssl_protocols = ["my", "favorite", "protocols"]
86: origin_keepalive_timeout = 12345
87: origin_read_timeout = 12345
88: }
…
what
why
map
, which can only contain values of a single type, so type checking prevents configuringcustom_origin_config
example errors
With explicit
tomap
With
{}
syntax