Skip to content

Commit b86685a

Browse files
Remove Count and rename variable
1 parent 5000586 commit b86685a

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

ssm.tf

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
resource "aws_ssm_parameter" "redis_endpoint" {
2-
count = var.secret_method == "ssm" ? 1 : 0
3-
name = "/elasticache/redis/${var.environment_name}-${var.name}/ENDPOINT"
2+
name = "/elasticache/redis/${var.env}-${var.name}/ENDPOINT"
43
description = "Elasticache Redis Endpoint"
54
type = "String"
6-
value = aws_elasticache_replication_group.redis[0].primary_endpoint_address
5+
value = aws_elasticache_replication_group.redis.primary_endpoint_address
76
}
87

98
resource "aws_ssm_parameter" "redis_port" {
10-
count = var.secret_method == "ssm" ? 1 : 0
11-
name = "/elasticache/redis/${var.environment_name}-${var.name}/PORT"
9+
name = "/elasticache/redis/${var.env}-${var.name}/PORT"
1210
description = "Elasticache Redis Port"
1311
type = "String"
14-
value = aws_elasticache_replication_group.redis[0].port
12+
value = aws_elasticache_replication_group.redis.port
1513
}

variables.tf

-6
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,3 @@ variable "notification_topic_arn" {
170170
type = string
171171
default = ""
172172
}
173-
174-
variable "secret_method" {
175-
description = "Use ssm for SSM parameters store which is the default option, or secretsmanager for AWS Secrets Manager"
176-
type = string
177-
default = "ssm"
178-
}

0 commit comments

Comments
 (0)