File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ resource "aws_ssm_parameter" "redis_endpoint" {
2
+ count = var. secret_method == " ssm" ? 1 : 0
3
+ name = " /elasticache/redis/${ var . environment_name } -${ var . name } /ENDPOINT"
4
+ description = " Elasticache Redis Endpoint"
5
+ type = " String"
6
+ value = aws_elasticache_replication_group. redis [0 ]. primary_endpoint_address
7
+ }
8
+
9
+ resource "aws_ssm_parameter" "redis_port" {
10
+ count = var. secret_method == " ssm" ? 1 : 0
11
+ name = " /elasticache/redis/${ var . environment_name } -${ var . name } /PORT"
12
+ description = " Elasticache Redis Port"
13
+ type = " String"
14
+ value = aws_elasticache_replication_group. redis [0 ]. port
15
+ }
Original file line number Diff line number Diff line change @@ -170,3 +170,9 @@ variable "notification_topic_arn" {
170
170
type = string
171
171
default = " "
172
172
}
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
+ }
You can’t perform that action at this time.
0 commit comments