Skip to content

Commit

Permalink
corrected circular reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed Nov 10, 2023
1 parent d86b09b commit a0db5ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cloudwatch.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
resource "aws_cloudwatch_log_group" "slow_log" {
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/slow-log"
name = "/elasticache/${var.replication_group_id}/slow-log"
retention_in_days = 365
kms_key_id = aws_kms_key.encrytion_rest.id
}
resource "aws_cloudwatch_log_group" "engine_log" {
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/engine-log"
name = "/elasticache/${var.replication_group_id}/engine-log"
retention_in_days = 365
kms_key_id = aws_kms_key.encrytion_rest.id
}
2 changes: 1 addition & 1 deletion elasticache.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "aws_secretsmanager_secret_version" "auth" {
resource "aws_elasticache_replication_group" "app4" {
automatic_failover_enabled = true
subnet_group_name = aws_elasticache_subnet_group.elasticache_subnet.name
replication_group_id = "app-4-redis-cluster"
replication_group_id = var.replication_group_id
description = "ElastiCache cluster for app4"
node_type = "cache.t2.small"
parameter_group_name = "default.redis7.cluster.on"
Expand Down
18 changes: 12 additions & 6 deletions variable.tf
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
#Define AWS Region
variable "region" {
description = "Infrastructure region"
description = "AWS Cloud infrastructure region."
type = string
default = "us-east-2"
}
#Define IAM User Access Key
variable "access_key" {
description = "The access_key that belongs to the IAM user"
description = "The access_key that belongs to the IAM user."
type = string
sensitive = true
default = ""
}
#Define IAM User Secret Key
variable "secret_key" {
description = "The secret_key that belongs to the IAM user"
description = "The secret_key that belongs to the IAM user."
type = string
sensitive = true
default = ""
}
variable "vpc_cidr" {
description = "the vpc cidr"
description = "CIDR for the VPC."
default = "10.20.32.0/25"
}
variable "subnet_cidr_private" {
description = "cidr blocks for the private subnets"
description = "CIDR blocks for the private subnets."
default = ["10.20.32.0/27", "10.20.32.32/27", "10.20.32.64/27"]
type = list(any)
}
variable "subnet_cidr_public" {
description = "cidr blocks for the public subnets"
description = "CIDR blocks for the public subnets."
default = ["10.20.32.96/27"]
type = list(any)
}

variable "replication_group_id" {
description = "The name of the ElastiCache replication group."
default = "app-4-redis-cluster"
type = string
}

0 comments on commit a0db5ed

Please sign in to comment.