Skip to content

Commit bab5cca

Browse files
committed
feat: allow to pass prefix for rule names
1 parent a8e0de0 commit bab5cca

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/karpenter/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ locals {
261261
resource "aws_cloudwatch_event_rule" "this" {
262262
for_each = { for k, v in local.events : k => v if local.enable_spot_termination }
263263

264-
name_prefix = "Karpenter${each.value.name}-"
264+
name_prefix = "${var.rule_name_prefix}${each.value.name}-"
265265
description = each.value.description
266266
event_pattern = jsonencode(each.value.event_pattern)
267267

modules/karpenter/variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,13 @@ variable "create_instance_profile" {
224224
type = bool
225225
default = true
226226
}
227+
228+
################################################################################
229+
# Event Bridge Rules
230+
################################################################################
231+
232+
variable "rule_name_prefix" {
233+
description = "Prefix used for all event bridge rules"
234+
type = string
235+
default = "Karpenter"
236+
}

0 commit comments

Comments
 (0)