Hi.
I have a following configuration:
locals {
vol_type = "${lookup(module.config_service_instance.result_map, "NOT_EXISTED!!!", "gp3")}"
root_block_device = "${list(map("volume_type", local.vol_type, "volume_size", var.root_volume_size, "delete_on_termination", "true"))}"
}
Running terraform plan I’m getting:
Error: module.master_node.module.ec2_instance.aws_instance.this: root_block_device: should be a list
It works as expected if I’m using explicitly defined string:
locals {
vol_type = "gp3"
root_block_device = "${list(map("volume_type", local.vol_type, "volume_size", var.root_volume_size, "delete_on_termination", "true"))}"
}
I thing that lookup function doesn’t evaluate correctly or returns a wrong data type.
It should return a string - “gp3”.
Terraform Version
Terraform v0.11.15