From e74cd5b17a44c49c51e6de5ae4c4ed5b8598eb85 Mon Sep 17 00:00:00 2001 From: mehdikarimian Date: Sun, 24 Apr 2022 18:41:23 +0430 Subject: [PATCH] update example version fix cluster_id --- examples/redis-basic/main.tf | 5 +++-- examples/redis-clustered-mode/main.tf | 5 +++-- examples/redis-replication-group/main.tf | 19 ++++++++++--------- main.tf | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/examples/redis-basic/main.tf b/examples/redis-basic/main.tf index 81974d6..d85e53f 100644 --- a/examples/redis-basic/main.tf +++ b/examples/redis-basic/main.tf @@ -19,9 +19,10 @@ module "vpc" { } module "redis" { - namespace = "redis-basic-example" + namespace = "redis-basic-" + cluster_name = "example" source = "Mehdikarimian/elasticache-redis-cluster/aws" - version = "1.0.0" + version = "1.0.3" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets node_type = "cache.t3.small" diff --git a/examples/redis-clustered-mode/main.tf b/examples/redis-clustered-mode/main.tf index ed84b71..5341bc7 100644 --- a/examples/redis-clustered-mode/main.tf +++ b/examples/redis-clustered-mode/main.tf @@ -19,9 +19,10 @@ module "vpc" { } module "redis" { - namespace = "redis-cluster-mode-example" + namespace = "redis-cluster-mode-" + cluster_name = "example" source = "Mehdikarimian/elasticache-redis-cluster/aws" - version = "1.0.0" + version = "1.0.3" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets node_type = "cache.t3.small" diff --git a/examples/redis-replication-group/main.tf b/examples/redis-replication-group/main.tf index fcc604e..b80618b 100644 --- a/examples/redis-replication-group/main.tf +++ b/examples/redis-replication-group/main.tf @@ -19,15 +19,16 @@ module "vpc" { } module "redis" { - namespace = "redis-replication-example" - source = "Mehdikarimian/elasticache-redis-cluster/aws" - version = "1.0.0" - vpc_id = module.vpc.vpc_id - subnet_ids = module.vpc.private_subnets - node_type = "cache.t3.small" - cluster_description = "redis replication group example description" - subnet_name = "redis-replication-group-example-subnet" - apply_immediately = true + namespace = "redis-replication-" + cluster_name = "example" + source = "Mehdikarimian/elasticache-redis-cluster/aws" + version = "1.0.3" + vpc_id = module.vpc.vpc_id + subnet_ids = module.vpc.private_subnets + node_type = "cache.t3.small" + cluster_description = "redis replication group example description" + subnet_name = "redis-replication-group-example-subnet" + apply_immediately = true number_replica = 3 diff --git a/main.tf b/main.tf index b169eff..ca7b4d8 100644 --- a/main.tf +++ b/main.tf @@ -32,7 +32,7 @@ resource "aws_elasticache_parameter_group" "redis" { } resource "aws_elasticache_replication_group" "default" { - replication_group_id = "${var.cluster_id}-${var.cluster_name}" + replication_group_id = "${var.namespace}-${var.cluster_name}" description = var.cluster_description security_group_ids = [aws_security_group.redis-security-group.id] node_type = var.node_type