Is it possible to set up a variable type
with optional elements? For instance, setting up a variable for an AWS security group rule:
variable "source_security_group_ingress_rules" {
description = "List of ingress rule objects to create."
type = list(
object(
{
from_port = string,
to_port = string,
protocol = string,
source_security_group_id = string,
description = string,
}
)
)
}
I’d like to make the description element optional. If I specify it, it is required. If I don’t specify it, it gets stripped if it is provided.