Hi
Is it possible to create 3 aws rds cluster instance when “rds_instance_creation” is true.
My code is shown below and its showing me some error.
I am not sure its possible to create resource this way
Please help me
variable “rds_instance_creation” {
type = bool
default = false
}
variable “restore_rds_instance” {
type = map(object({
instance = string
instance_count = number
})
}
restore_rds_instance = {
“ns” = {
instance = “instance”
instance_count = 3
}
}
resource “null_resource” “names” {
for_each = merge([for k, v in var.restore_rds_instance : if var.rds_instance_creation
{ for i in range(v.qty) : “rds-{i + 1}” => k }
]…)
}