Skip to content

Conversation

@Weastie
Copy link

@Weastie Weastie commented Nov 20, 2025

Description

Added variable rule_name_use_terraform_prefix to the Karpenter submodule that allows disabling the Terraform generated suffix to Cloudwatch Event rules generated by the submodule.

Motivation and Context

When directly using the Karpenter submodule, there is no configuration present to disable the Terraform suffix applied to the Cloudwatch Event rules. I personally ran into the problem of hitting the AWS imposed length limit of 64.

The Cloudwatch Event rule for the InstanceStateChange rule, for example, uses 46 characters for the "InstanceStateChange-" part plus the 26 characters of Terraform's auto-generated suffix, leaving only 18 characters left for the user inputted rule_name_prefix.

Breaking Changes

Backwards compatibility is provided because the variable is optional and defaults to the previous behavior when omitted.

How Has This Been Tested?

Because of how small this change is, I just tested it by replacing the source of the Karpenter module in my code to my PR repo, and tested that:

  • Omitting the rule_name_use_terraform_prefix variable resulted in no changes and no errors
  • Setting the rule_name_use_terraform_prefix variable to true (default) resulted in no changes and no errors
  • Setting the rule_name_use_terraform_prefix variable to false resulted in renaming of the Cloudwatch Event rules and no errors
  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@Weastie Weastie changed the title Add variable for configuring Karpenter rule name prefix Add variable for configuring Karpenter Cloudwatch Event rule name prefix Nov 20, 2025
@Weastie Weastie changed the title Add variable for configuring Karpenter Cloudwatch Event rule name prefix feat: Add variable for configuring Karpenter Cloudwatch Event rule name prefix Nov 20, 2025
@bryantbiggs
Copy link
Member

thank you but we do not plan on accepting this change - the prefix prevents several errors or situations that lead to errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants