terraform-aws-modules / terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
Apache License 2.0
4.47k stars 4.08k forks source link

[karpenter] enable ability to import existing eventbridge rules #3127

Closed k24dizzle closed 3 months ago

k24dizzle commented 3 months ago

Since there isn't a way to specify the name of these rules:

resource "aws_cloudwatch_event_rule" "this" {
  for_each = { for k, v in local.events : k => v if local.enable_spot_termination }

  name_prefix   = "${var.rule_name_prefix}${each.value.name}-"
  description   = each.value.description
  event_pattern = jsonencode(each.value.event_pattern)

  tags = merge(
    { "ClusterName" : var.cluster_name },
    var.tags,
  )
}

(only the name_prefix), it isn't easy to import these rules.

Screenshot 2024-08-16 at 1 55 42 PM

Is it ok having multiple duplicate eventbridge rules that route to the karpenter sqs interruption queue? Will karpenter be able to deduplicate them?

bryantbiggs commented 3 months ago

Are those for the same cluster or different clusters? Why so many copies of rules?

k24dizzle commented 3 months ago

Are those for the same cluster or different clusters? Why so many copies of rules?

same cluster, I kept deleting my terraform state file so that's why it continued to make copies

bryantbiggs commented 3 months ago

I would just delete all of the rules manually and re-apply and that should leave just one set of the rules

bryantbiggs commented 3 months ago

closing since this isn't a module relate issue

github-actions[bot] commented 2 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.