From ec9fce9527c3dfcb2adec18bb26d9e582c7b8cb3 Mon Sep 17 00:00:00 2001 From: Faris Date: Tue, 20 Aug 2024 20:11:36 +0200 Subject: [PATCH 1/6] fix: added output cluster_members for resource aws_docdb_cluster --- outputs.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/outputs.tf b/outputs.tf index 832ef27..9d35f28 100644 --- a/outputs.tf +++ b/outputs.tf @@ -29,6 +29,11 @@ output "reader_endpoint" { description = "A read-only endpoint of the DocumentDB cluster, automatically load-balanced across replicas" } +output "cluster_members" { + value = aws_docdb_cluster.default[*].cluster_members + description = "List of lists of DocumentDB Instances that are a part of this cluster" +} + output "master_host" { value = module.dns_master.hostname description = "DB master hostname" From d602b7b46ef6e63374c91d2d08626b89054c5b8e Mon Sep 17 00:00:00 2001 From: Faris Date: Mon, 26 Aug 2024 16:14:18 +0200 Subject: [PATCH 2/6] fix: added flatten() --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index 9d35f28..7beff49 100644 --- a/outputs.tf +++ b/outputs.tf @@ -30,8 +30,8 @@ output "reader_endpoint" { } output "cluster_members" { - value = aws_docdb_cluster.default[*].cluster_members - description = "List of lists of DocumentDB Instances that are a part of this cluster" + value = flatten(aws_docdb_cluster.default[*].cluster_members) + description = "List of DocumentDB Instances that are a part of this cluster" } output "master_host" { From c0026e9c0e5c26ea3f18c7f2765662f80a73fa4b Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 5 Sep 2024 18:55:07 +0200 Subject: [PATCH 3/6] format --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 7beff49..719d402 100644 --- a/outputs.tf +++ b/outputs.tf @@ -30,7 +30,7 @@ output "reader_endpoint" { } output "cluster_members" { - value = flatten(aws_docdb_cluster.default[*].cluster_members) + value = flatten(aws_docdb_cluster.default[*].cluster_members) description = "List of DocumentDB Instances that are a part of this cluster" } From 5e8fcaa8802e23da487a70462d445fb8f32854eb Mon Sep 17 00:00:00 2001 From: Faris Date: Wed, 25 Sep 2024 15:48:40 +0200 Subject: [PATCH 4/6] feature: added instance_class as an output --- outputs.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/outputs.tf b/outputs.tf index 7beff49..26ed099 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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] +} \ No newline at end of file From 462fa7bd26538964b6c9a86e9ed62959c8d71253 Mon Sep 17 00:00:00 2001 From: Matt Gowie Date: Wed, 25 Sep 2024 09:00:58 -0600 Subject: [PATCH 5/6] chore: adds final newline --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 63a2123..4ba109c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -62,4 +62,4 @@ output "security_group_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] -} \ No newline at end of file +} From 06c0eb050e91b1b8d50a578f12a340090f65e8a3 Mon Sep 17 00:00:00 2001 From: Faris Date: Thu, 26 Sep 2024 09:33:52 +0200 Subject: [PATCH 6/6] fix: used the variable instance _class as the output to avoid the loop --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index 63a2123..b932142 100644 --- a/outputs.tf +++ b/outputs.tf @@ -60,6 +60,6 @@ output "security_group_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] + description = "The instance class 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 = var.instance_class } \ No newline at end of file