From 8e06775e5379d3da45f6eeaeb273d54268044b3d Mon Sep 17 00:00:00 2001 From: Ott Ramst Date: Wed, 9 Oct 2024 14:24:28 +0300 Subject: [PATCH 1/5] Change cloudwatch log group output to include all created log groups --- outputs.tf | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/outputs.tf b/outputs.tf index 2b4cf6f..e3df97a 100644 --- a/outputs.tf +++ b/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = try(aws_cloudwatch_log_group.this[0].name, null) -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = try(aws_cloudwatch_log_group.this[0].arn, null) +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = aws_cloudwatch_log_group.this } ################################################################################ From 5db26d15e626d470f58f4d661d1d48b890f9b144 Mon Sep 17 00:00:00 2001 From: Ott Ramst Date: Wed, 9 Oct 2024 17:12:44 +0300 Subject: [PATCH 2/5] Update docs --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc03bfb..06086f2 100644 --- a/README.md +++ b/README.md @@ -344,7 +344,7 @@ No modules. | [global\_replication\_group\_id](#input\_global\_replication\_group\_id) | The ID of the global replication group to which this replication group should belong | `string` | `null` | no | | [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `null` | no | -| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | +| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | | [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC) | `string` | `null` | no | | [multi\_az\_enabled](#input\_multi\_az\_enabled) | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to `false` | `bool` | `false` | no | | [network\_type](#input\_network\_type) | The IP versions for cache cluster connections. Valid values are `ipv4`, `ipv6` or `dual_stack` | `string` | `null` | no | @@ -388,8 +388,7 @@ No modules. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | From 4d7aabdb428106c47f77dd4b7d6879404df1397a Mon Sep 17 00:00:00 2001 From: Ott Ramst Date: Fri, 18 Oct 2024 11:39:11 +0300 Subject: [PATCH 3/5] Update examples --- examples/memcached-cluster/README.md | 3 +-- examples/memcached-cluster/outputs.tf | 11 +++-------- examples/redis-cluster-mode/README.md | 3 +-- examples/redis-cluster-mode/outputs.tf | 11 +++-------- examples/redis-cluster/README.md | 3 +-- examples/redis-cluster/outputs.tf | 11 +++-------- examples/redis-global-replication-group/README.md | 3 +-- examples/redis-global-replication-group/outputs.tf | 11 +++-------- .../README.md | 3 +-- .../outputs.tf | 11 +++-------- examples/redis-replication-group/README.md | 3 +-- examples/redis-replication-group/outputs.tf | 11 +++-------- 12 files changed, 24 insertions(+), 60 deletions(-) diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index 71fe41a..d0704bf 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -50,8 +50,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/memcached-cluster/outputs.tf b/examples/memcached-cluster/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/memcached-cluster/outputs.tf +++ b/examples/memcached-cluster/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index 9d1a578..18f5b5d 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -52,8 +52,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-cluster-mode/outputs.tf b/examples/redis-cluster-mode/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-cluster-mode/outputs.tf +++ b/examples/redis-cluster-mode/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index 1d3d4f4..7372943 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -50,8 +50,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-cluster/outputs.tf b/examples/redis-cluster/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-cluster/outputs.tf +++ b/examples/redis-cluster/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 7ee97b6..7b1b68f 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -57,8 +57,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-global-replication-group/outputs.tf b/examples/redis-global-replication-group/outputs.tf index 45505ae..85300ce 100644 --- a/examples/redis-global-replication-group/outputs.tf +++ b/examples/redis-global-replication-group/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache_primary.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache_primary.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache_primary.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 7c3b025..745335c 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -51,8 +51,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-replication-group-with-cluster-replica/outputs.tf b/examples/redis-replication-group-with-cluster-replica/outputs.tf index b1e108b..c649115 100644 --- a/examples/redis-replication-group-with-cluster-replica/outputs.tf +++ b/examples/redis-replication-group-with-cluster-replica/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.replication_group_with_cluster_replica.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.replication_group_with_cluster_replica.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.replication_group_with_cluster_replica.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index 75d8720..935104a 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -49,8 +49,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-replication-group/outputs.tf b/examples/redis-replication-group/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-replication-group/outputs.tf +++ b/examples/redis-replication-group/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ From 9344deed8ef9eff99f5a1e0d64f25d1066ca7aa3 Mon Sep 17 00:00:00 2001 From: Ott Ramst Date: Mon, 2 Dec 2024 14:39:46 +0200 Subject: [PATCH 4/5] Reinstate log group outputs --- outputs.tf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/outputs.tf b/outputs.tf index e3df97a..e015a78 100644 --- a/outputs.tf +++ b/outputs.tf @@ -99,6 +99,18 @@ output "cloudwatch_log_groups" { value = aws_cloudwatch_log_group.this } +# TODO - remove at next breaking change +output "cloudwatch_log_group_name" { + description = "Name of cloudwatch log group created" + value = try(aws_cloudwatch_log_group.this[0].name, null) +} + +# TODO - remove at next breaking change +output "cloudwatch_log_group_arn" { + description = "Arn of cloudwatch log group created" + value = try(aws_cloudwatch_log_group.this[0].arn, null) +} + ################################################################################ # Parameter Group ################################################################################ From 77f0b4be598412de3dd1ca96ea2229383cb1f2d8 Mon Sep 17 00:00:00 2001 From: Ott Ramst Date: Mon, 2 Dec 2024 14:41:40 +0200 Subject: [PATCH 5/5] Reinstate log group outputs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index afc8008..930c1d8 100644 --- a/README.md +++ b/README.md @@ -389,6 +389,8 @@ No modules. | Name | Description | |------|-------------| +| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | +| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | | [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |