Skip to content

Commit bd0b8a8

Browse files
authored
Merge pull request #15 from Opcity/twelvelabs/fix_regex
fix: Support primary endpoint URL format
2 parents e3b8b86 + 67e68bc commit bd0b8a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

locals.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ locals {
33
slowlog_check_archive_hash = "H2YmQMqSwV8uSC6TXVJJLykkYUTj1e+g8Bi9Nijiex4="
44
slowlog_check_archive_path = "${path.module}/files/${local.slowlog_check_archive_basename}"
55

6-
search_replication_group = "(?P<first>[0-9A-Za-z_-]+)\\.(?P<second>[0-9A-Za-z_-]+)\\.{0,1}(?P<third>[0-9A-Za-z_]*)\\.(?P<region>[0-9A-Za-z_-]+)\\.cache\\.amazonaws\\.com:{0,1}(?P<port>[0-9]*)"
6+
# https://pythex.org/?regex=(%3FP%3Cfirst%3E%5B0-9A-Za-z_-%5D%2B)%5C.(%3FP%3Csecond%3E%5B0-9A-Za-z_-%5D%2B)%5C.%7B0%2C1%7D(%3FP%3Cthird%3E%5B0-9A-Za-z_%5D*)%5C.%7B0%2C1%7D(%3FP%3Cfourth%3E%5B0-9A-Za-z_%5D*)%5C.(%3FP%3Cregion%3E%5B0-9A-Za-z_-%5D%2B)%5C.cache%5C.amazonaws%5C.com%3A%7B0%2C1%7D(%3FP%3Cport%3E%5B0-9%5D*)&test_string=cluster-one.abcdef.0001.use1.cache.amazonaws.com%3A6379%0Acluster-two.abcdef.ng.0001.use1.cache.amazonaws.com%3A6379%0Amaster.cluster-three.abcdef.use1.cache.amazonaws.com%3A6379%0A&ignorecase=0&multiline=0&dotall=0&verbose=0
7+
search_replication_group = "(?P<first>[0-9A-Za-z_-]+)\\.(?P<second>[0-9A-Za-z_-]+)\\.{0,1}(?P<third>[0-9A-Za-z_]*)\\.{0,1}(?P<fourth>[0-9A-Za-z_]*)\\.(?P<region>[0-9A-Za-z_-]+)\\.cache\\.amazonaws\\.com:{0,1}(?P<port>[0-9]*)"
78
parsed_elasticache_endpoint = regex(local.search_replication_group, var.elasticache_endpoint)
89
# https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Endpoints.html
910
replication_group = contains(["clustercfg", "master"], local.parsed_elasticache_endpoint["first"]) ? local.parsed_elasticache_endpoint["second"] : local.parsed_elasticache_endpoint["first"]

0 commit comments

Comments
 (0)