I have several sets of resources of the aws_instance type, e.g. N nginx instances, M php instances etc. I would like to create an output which will print the names of all instances of all types.
It is easy to output all intances of one type:
output "ec2_instances" {
description = "Names of EC2 instances"
value = aws_instance.nginx.*.tags.Name
}
but how can I output really all types in one output? A construction like aws_instance.*.*.tags.Name does not pass validation.
You are still enumerating instance types in concat(aws_instance.nginx.*.tags.Name, aws_instance.php.*.tags.Name) (i.e. you explicitly mention “nginx”, “php” etc) but I would like to avoid that. The whole purpose is to output all instances no matter of their type because enumerating does not scale well.