Skip to content

Commit

Permalink
fix: Change cloudwatch log group output to include all created log gr…
Browse files Browse the repository at this point in the history
…oups (#19)
  • Loading branch information
ottramst authored Dec 2, 2024
1 parent aaf3837 commit cdc870e
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 60 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ No modules.
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
3 changes: 1 addition & 2 deletions examples/memcached-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/memcached-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/redis-cluster-mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/redis-cluster-mode/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/redis-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/redis-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/redis-global-replication-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/redis-global-replication-group/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/redis-replication-group-with-cluster-replica/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/redis-replication-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created |
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created |
| <a name="output_cloudwatch_log_groups"></a> [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes |
| <a name="output_cluster_address"></a> [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster |
| <a name="output_cluster_cache_nodes"></a> [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` |
Expand Down
11 changes: 3 additions & 8 deletions examples/redis-replication-group/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

################################################################################
Expand Down
7 changes: 7 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,18 @@ output "global_replication_group_node_groups" {
# CloudWatch Log Group
################################################################################

output "cloudwatch_log_groups" {
description = "Map of CloudWatch log groups created and their attributes"
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)
Expand Down

0 comments on commit cdc870e

Please sign in to comment.