Skip to content

Commit 60a512d

Browse files
author
Abdul Wahid
authored
Fix outputs for endpoints (#29)
1 parent a25f37f commit 60a512d

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ All notable changes to this project will be documented in this file.
1616
- Upgrade module to be compatible with AWS Provider 4.0.0 ([#21](https://github.com/umotif-public/terraform-aws-elasticache-redis/issues/21))
1717

1818

19+
<a name="3.0.0"></a>
20+
## [3.0.0] - 2022-03-09
21+
22+
- Upgrade module to be compatible with AWS Provider 4.0.0 ([#21](https://github.com/umotif-public/terraform-aws-elasticache-redis/issues/21))
23+
24+
1925
<a name="2.2.0"></a>
2026
## [2.2.0] - 2021-08-11
2127

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ A Terraform module to create an AWS Redis ElastiCache cluster
1616
```hcl
1717
module "redis" {
1818
source = "umotif-public/elasticache-redis/aws"
19-
version = "~> v3.0"
19+
version = "~> 3.0.0"
2020
2121
name_prefix = "core-example"
22-
number_cache_clusters = 2
22+
num_cache_cluster = 2
2323
node_type = "cache.t3.small"
2424
2525
engine_version = "6.x"

examples/redis-clustered-mode/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module "redis" {
2828

2929
cluster_mode_enabled = true
3030
replicas_per_node_group = 1
31-
num_node_groups = 1
31+
num_node_groups = 2
3232

3333
engine_version = "6.x"
3434
port = 6379
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
output "primary_endpoint" {
2+
value = module.redis.elasticache_replication_group_primary_endpoint_address
3+
}
4+
5+
output "reader_endpoint" {
6+
value = module.redis.elasticache_replication_group_reader_endpoint_address
7+
}

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ output "elasticache_replication_group_id" {
99
}
1010

1111
output "elasticache_replication_group_primary_endpoint_address" {
12-
value = var.num_node_groups > 1 ? aws_elasticache_replication_group.redis.configuration_endpoint_address : aws_elasticache_replication_group.redis.primary_endpoint_address
12+
value = var.num_node_groups > 0 ? aws_elasticache_replication_group.redis.configuration_endpoint_address : aws_elasticache_replication_group.redis.primary_endpoint_address
1313
description = "The address of the endpoint for the primary node in the replication group."
1414
}
1515

1616
output "elasticache_replication_group_reader_endpoint_address" {
17-
value = var.num_node_groups > 1 ? aws_elasticache_replication_group.redis.configuration_endpoint_address : aws_elasticache_replication_group.redis.reader_endpoint_address
17+
value = var.num_node_groups > 0 ? aws_elasticache_replication_group.redis.configuration_endpoint_address : aws_elasticache_replication_group.redis.reader_endpoint_address
1818
description = "The address of the endpoint for the reader node in the replication group."
1919
}
2020

0 commit comments

Comments
 (0)