Skip to content

Commit

Permalink
Merge pull request #28 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 2.0.1 - destroy the unused Elasticache resources
  • Loading branch information
briskt authored May 25, 2023
2 parents 559d348 + 2c73970 commit a56eb73
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ module "ecs-service-cloudwatch-dashboard" {
* Create Elasticache subnet group
*/
resource "aws_elasticache_subnet_group" "memcache_subnet_group" {
count = 1
# count = var.session_store_type == "memcache" ? 1 : 0
count = var.session_store_type == "memcache" ? 1 : 0

name = local.app_name_and_env
subnet_ids = data.terraform_remote_state.common.outputs.private_subnet_ids
Expand All @@ -113,8 +112,7 @@ resource "aws_elasticache_subnet_group" "memcache_subnet_group" {
* Create Elasticache cluster
*/
resource "aws_elasticache_cluster" "memcache" {
count = 1
# count = var.session_store_type == "memcache" ? 1 : 0
count = var.session_store_type == "memcache" ? 1 : 0

cluster_id = local.app_name_and_env
engine = "memcached"
Expand All @@ -136,8 +134,7 @@ resource "aws_elasticache_cluster" "memcache" {
* Create RDS root password
*/
resource "random_password" "db_root" {
count = 1
# count = var.session_store_type == "sql" ? 1 : 0
count = var.session_store_type == "sql" ? 1 : 0

length = 16
override_special = "!#$%&*()-_=+[]{}<>:?"
Expand All @@ -147,8 +144,7 @@ resource "random_password" "db_root" {
* Create RDS database for session store, if session_store_type is "sql"
*/
module "rds" {
count = 1
# count = var.session_store_type == "sql" ? 1 : 0
count = var.session_store_type == "sql" ? 1 : 0

source = "github.com/silinternational/terraform-modules//aws/rds/mariadb?ref=8.0.1"

Expand Down

0 comments on commit a56eb73

Please sign in to comment.