Skip to content

Commit 2937952

Browse files
authored
Merge pull request #5 from yaradigitallabs/update-format-length
adding flexible length formatting for redis instance name
2 parents 288449a + b6a5f59 commit 2937952

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
@@ -7,7 +7,7 @@ resource "random_id" "salt" {
77
}
88

99
resource "aws_elasticache_replication_group" "redis" {
10-
replication_group_id = format("%.40s", "${var.name}-${var.env}")
10+
replication_group_id = format("${var.format_length}", "${var.name}-${var.env}")
1111
description = "Terraform-managed ElastiCache replication group for ${var.name}-${var.env}"
1212
num_cache_clusters = var.redis_clusters
1313
node_type = var.redis_node_type

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ variable "name" {
5454
type = string
5555
}
5656

57+
variable "format_length" {
58+
description = "Length formatting for redis instance name"
59+
type = string
60+
default = "%.40s"
61+
}
62+
5763
variable "redis_clusters" {
5864
description = "Number of Redis cache clusters (nodes) to create"
5965
type = string

0 commit comments

Comments
 (0)