Skip to content

Commit

Permalink
fix on parameter group cluster mode off defualt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdikarimian committed Apr 24, 2022
1 parent 18f1e1b commit e43a4e6
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
39 changes: 39 additions & 0 deletions examples/redis-replication-group/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module "vpc" {
source = "terraform-aws-modules/vpc/aws"

name = "simple-vpc"
cidr = "10.2.0.0/16"

azs = ["ca-central-1a", "ca-central-1b"]
private_subnets = ["10.2.1.0/24", "10.2.2.0/24"]
public_subnets = ["10.2.101.0/24", "10.2.102.0/24"]

enable_nat_gateway = true
single_nat_gateway = false

tags = {
Name = "simple-vpc"
Enviroment = "Production"
}

}

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

number_replica = 3

security_group_name = "redis-replication-group-example-security-group"
tags = {
Name = "redis-replication-group-example"
Enviroment = "Production",
}
}
4 changes: 4 additions & 0 deletions examples/redis-replication-group/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
provider "aws" {
region = var.aws_region
profile = var.profile
}
10 changes: 10 additions & 0 deletions examples/redis-replication-group/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "profile" {
description = ""
}

variable "aws_region" {
default = "ca-central-1"
description = "aws region where our resources going to create choose"
#replace the region as suits for your requirement
}

10 changes: 10 additions & 0 deletions examples/redis-replication-group/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 0.14.9"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.11.0"
}
}
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
subnet_group_name = var.subnet_name == "" ? var.namespace : "${var.namespace}-${var.subnet_name}"
parameter_group_name = var.cluster_mode ? "default.${var.family}.cluster.on" : "${var.namespace}.${var.family}"
parameter_group_name = var.cluster_mode ? "default.${var.family}.cluster.on" : "default.${var.family}"
}
resource "aws_elasticache_subnet_group" "default" {
Expand Down

0 comments on commit e43a4e6

Please sign in to comment.