Skip to content
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ output "security_group_name" {
description = "Name of the DocumentDB cluster Security Group"
value = join("", aws_security_group.default[*].name)
}

output "instance_class" {
description = "The instance calss used by the DocumentDB Cluster. For more details, see https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-classes.html#db-instance-class-specs"
value = distinct([for instance in aws_docdb_cluster_instance.default : instance.instance_class])[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Faris96Hub how is this different from var.instance_class? Or is not different and you're using the default of that value, so you need it as an output? If the latter... can we just output var.instance_class instead of adding this looping logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not using the default but using var.instance_class would be an option too, to avoid the loop. Ill change it

}