Reputation: 140
I have a terraform file which is making a module call to terraform templates to provision a server in vmware as below :
I am trying to get the list of hostnames in local block to pass to cert genration logic.
locals {
rs_hostnames = tolist(flatten(module.er[*].name))
rs_instance_ids = tolist(flatten(module.er[*].uuid))
}
module "er" {
source = "git::https://abc/repo?branch"
vms = var.kl //list of hostnames and ip addresses
}
variables.tf:
--------------
variable "kl" {
type = map(object({
name = string
vm_ip = string
}))
}
Getting error message for module.er[*].name This object does not have attribute called "name" or "uuid"
Upvotes: 0
Views: 32