From b180274d1e7d5aa9184cdd8a05a3e663b369da62 Mon Sep 17 00:00:00 2001 From: Alexey Dubkov Date: Tue, 22 Jul 2025 21:08:49 -0700 Subject: [PATCH] add option to customize global_replication_group_id_suffix --- README.md | 1 + main.tf | 2 +- variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e437ed6..64bec7f 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,7 @@ No modules. | [engine\_version](#input\_engine\_version) | Version number of the cache engine to be used. If not set, defaults to the latest version | `string` | `null` | no | | [final\_snapshot\_identifier](#input\_final\_snapshot\_identifier) | (Redis only) Name of your final cluster snapshot. If omitted, no final snapshot will be made | `string` | `null` | no | | [global\_replication\_group\_id](#input\_global\_replication\_group\_id) | The ID of the global replication group to which this replication group should belong | `string` | `null` | no | +| [global\_replication\_group\_id\_suffix](#input\_global\_replication\_group\_id\_suffix) | The ID suffix of the global replication group | `string` | `null` | no | | [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `null` | no | | [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis OSS or Valkey) Specifies the destination and format of Redis OSS/Valkey SLOWLOG or Redis OSS/Valkey Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | diff --git a/main.tf b/main.tf index cdeb42a..d02b7aa 100644 --- a/main.tf +++ b/main.tf @@ -144,7 +144,7 @@ resource "aws_elasticache_global_replication_group" "this" { cache_node_type = var.node_type engine_version = var.engine_version - global_replication_group_id_suffix = var.replication_group_id + global_replication_group_id_suffix = coalesce(var.global_replication_group_id_suffix, var.replication_group_id) global_replication_group_description = coalesce(var.description, "Global replication group") primary_replication_group_id = aws_elasticache_replication_group.global[0].id parameter_group_name = local.parameter_group_name_result diff --git a/variables.tf b/variables.tf index f4049d6..d157d04 100644 --- a/variables.tf +++ b/variables.tf @@ -239,6 +239,12 @@ variable "global_replication_group_id" { default = null } +variable "global_replication_group_id_suffix" { + description = "The ID suffix of the global replication group" + type = string + default = null +} + variable "kms_key_arn" { description = "The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true`" type = string