kubernetes/kops · error

error listing EventBridge rules: %v

Error message

error listing EventBridge rules: %v

What it means

EventBridgeRule.Find lists rules with ListRules(NamePrefix=ruleName) to reconcile declared EventBridge rules. Any AWS error from ListRules is wrapped as 'error listing EventBridge rules: %v'. This is an API-level failure during lookup, not an indication about rule presence.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/eventbridgerule.go:64

var _ fi.CompareWithID = (*EventBridgeRule)(nil)

func (eb *EventBridgeRule) CompareWithID() *string {
	return eb.Name
}

func (eb *EventBridgeRule) Find(c *fi.CloudupContext) (*EventBridgeRule, error) {
	cloud := awsup.GetCloud(c)

	if eb.Name == nil {
		return nil, nil
	}

	request := &eventbridge.ListRulesInput{
		NamePrefix: eb.Name,
	}
	response, err := cloud.EventBridge().ListRules(c.Context(), request)
	if err != nil {
		return nil, fmt.Errorf("error listing EventBridge rules: %v", err)
	}
	if response == nil || len(response.Rules) == 0 {
		return nil, nil
	}
	if len(response.Rules) > 1 {
		return nil, fmt.Errorf("found multiple EventBridge rules with the same name")
	}

	rule := response.Rules[0]

	tagResponse, err := cloud.EventBridge().ListTagsForResource(c.Context(), &eventbridge.ListTagsForResourceInput{ResourceARN: rule.Arn})
	if err != nil {
		return nil, fmt.Errorf("error listing tags for EventBridge rule: %v", err)
	}

	actual := &EventBridgeRule{
		ID:           eb.ID,
		Name:         eb.Name,

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Grant events:ListRules (and events:ListTagsForResource) in the kops IAM policy
  2. Confirm the cluster's region is correct — EventBridge rules are regional
  3. Retry after throttling/transient errors
  4. Check the underlying error text in the message for the exact AWS SDK failure

Example fix

// before
// policy missing events actions
// after
{"Effect":"Allow","Action":["events:ListRules","events:ListTagsForResource","events:PutRule"],"Resource":"*"}
Defensive patterns

Strategy: retry

Validate before calling

// pre-check permissions
// aws iam simulate-principal-policy --action-names events:ListRules
if region == "" { return errors.New("region required for EventBridge (rules are regional)") }

Try / catch

var ae smithy.APIError
if errors.As(err, &ae) {
    if ae.ErrorCode() == "ThrottlingException" { /* backoff & retry */ }
    if ae.ErrorCode() == "AccessDeniedException" { /* fix IAM: events:ListRules */ }
}

Prevention

When it happens

Trigger: cloud.EventBridge().ListRules fails: IAM denial of events:ListRules, invalid/missing region endpoint, throttling, or network errors during kops reconciliation of a cluster with EventBridge rules (e.g. trust to sqs for EventBridge notifications).

Common situations: Least-privilege IAM lacking events:ListRules; wrong region configuration (rules are regional); transient AWS events endpoint failures.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/f2937480afcd442e. Report an issue: GitHub.