Skip to content

Commit c9b9365

Browse files
Add a variable to customize the Redis DNS name
1 parent 1a431a5 commit c9b9365

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
143143
module "dns" {
144144
source = "git::https://github.com/cloudposse/terraform-aws-route53-cluster-hostname.git?ref=tags/0.3.0"
145145
enabled = var.enabled && var.zone_id != "" ? true : false
146-
name = var.name
146+
name = length(var.host_name) > 0 ? var.host_name : module.label.id
147147
ttl = 60
148148
zone_id = var.zone_id
149149
records = [join("", aws_elasticache_replication_group.default.*.primary_endpoint_address)]

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ variable "auth_token" {
180180
default = ""
181181
}
182182

183+
variable "host_name" {
184+
type = string
185+
description = "The DNS subdomain to add to Route53 for the cluster."
186+
default = ""
187+
}
188+
183189
variable "replication_group_id" {
184190
type = string
185191
description = "Replication group ID with the following constraints: \nA name must contain from 1 to 20 alphanumeric characters or hyphens. \n The first character must be a letter. \n A name cannot end with a hyphen or contain two consecutive hyphens."

0 commit comments

Comments
 (0)