Skip to content

Commit 2f30ea2

Browse files
authored
feat: Add option to customize global_replication_group_id_suffix (#47)
1 parent c38b484 commit 2f30ea2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ No modules.
425425
| <a name="input_engine_version"></a> [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 |
426426
| <a name="input_final_snapshot_identifier"></a> [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 |
427427
| <a name="input_global_replication_group_id"></a> [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 |
428+
| <a name="input_global_replication_group_id_suffix"></a> [global\_replication\_group\_id\_suffix](#input\_global\_replication\_group\_id\_suffix) | The ID suffix of the global replication group | `string` | `null` | no |
428429
| <a name="input_ip_discovery"></a> [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no |
429430
| <a name="input_kms_key_arn"></a> [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 |
430431
| <a name="input_log_delivery_configuration"></a> [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` | <pre>{<br/> "slow-log": {<br/> "destination_type": "cloudwatch-logs",<br/> "log_format": "json"<br/> }<br/>}</pre> | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ resource "aws_elasticache_global_replication_group" "this" {
144144
cache_node_type = var.node_type
145145
engine_version = var.engine_version
146146

147-
global_replication_group_id_suffix = var.replication_group_id
147+
global_replication_group_id_suffix = coalesce(var.global_replication_group_id_suffix, var.replication_group_id)
148148
global_replication_group_description = coalesce(var.description, "Global replication group")
149149
primary_replication_group_id = aws_elasticache_replication_group.global[0].id
150150
parameter_group_name = local.parameter_group_name_result

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ variable "global_replication_group_id" {
239239
default = null
240240
}
241241

242+
variable "global_replication_group_id_suffix" {
243+
description = "The ID suffix of the global replication group"
244+
type = string
245+
default = null
246+
}
247+
242248
variable "kms_key_arn" {
243249
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`"
244250
type = string

0 commit comments

Comments
 (0)