Skip to content

feat(#1613, #1640): EventBridge buses, per-bus rules, enable/disable, tagging provider - #1701

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/v0134-eventbridge
Nov 25, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/v0134-eventbridge

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Fixes #1640
Part of #1613: this is the EventBridge part (buses, per-bus rules, enable/disable). Archives, replays, connections, API destinations and TestEventPattern are #1691.

  • Event buses. This adds CreateEventBus, DescribeEventBus, UpdateEventBus and DeleteEventBus.
    • A bus record holds Description, KmsKeyIdentifier, DeadLetterConfig, LogConfig, Policy, Tags and ever_tagged.
    • Every account and Region has a default bus. It is synthesized until a write gives it a record, and deleting it is refused.
    • ListEventBuses now answers from the records. It pages through page[T] on NamePrefix, Limit and NextToken.
    • DeleteEventBus refuses while the bus has rules, with ValidationException and AWS's observed EventBus can't be deleted since it has rules..
    • Creating more than 100 buses (counting default) is LimitExceededException.
    • A partner bus (one with EventSourceName) is refused with ResourceNotFoundException, because no partner event sources are modelled.
  • Bus policy. PutPermission and RemovePermission edit the policy that DescribeEventBus reports. They take either Policy, or a StatementId/Action/Principal/Condition statement, which replaces any statement with the same Sid. A policy over 10,240 characters is PolicyLengthExceededException. The statement shape is the one aws_cloudwatch_event_permission reads back.
  • Rules keyed per bus. Rules are keyed by (account, Region, bus, name). A custom-bus rule's ARN is rule/{bus}/{name}.
    • Migration-free: a default-bus rule keeps the exact key, target key and name-index key every rule had before. So a pre-v0.134 record is read as the default-bus rule it always was, and nothing is rewritten.
    • A custom-bus rule inserts the bus segment. Rule names are now validated against [.\-_A-Za-z0-9]{1,64}, which has no /, so the two key forms cannot collide.
    • TestEBRules_APreV0134RecordIsTheDefaultBusRule loads a legacy record, its targets and its index. It then lists, describes, disables, tags, reads GetResources and deletes.
    • Every rule operation honors EventBusName (name or ARN). PutRule refuses a bus that does not exist and enforces the 300-rules-per-bus quota.
  • Rule operations. Adds EnableRule, DisableRule and ListRuleNamesByTarget. The last is a new op, paged by page[T].
  • Tagging provider (Tagging API: TagResources/UntagResources on EventBridge rule ARNs #1640). EventBridge implements resourceTagger and taggableResourceLister for both rules and buses. Writes go under ruleMu, through one state-taking merge (ebMergeTagsAt) shared with EventBridge's own TagResource and the tagging plugin's direct path.
    • TagResources refuses aws: keys, and an owner's quota and length refusals come back as its own codes.
    • taggingARNOwner gains events→eventbridge, and resolveARN and mergeResourceTags gain events arms.
    • GetResources scans through the lister and now includes buses.
    • The event-bus/ arm of ebParseTagARN resolves to the bus record.
  • CloudFormation. Adds AWS::Events::EventBus, with its cfnResourceDeployers row, a delete, Fn::GetAtt Arn/Name, Policy through PutPermission, and in-place updates (Name replaces). AWS::Events::Rule is created and deleted on its EventBusName, and passes RoleArn and Tags.
  • Wording. Rule X does not exist on EventBus Y., Event bus X does not exist., Event bus X already exists. and EventBus can't be deleted since it has rules. are AWS's observed text. Sources are cited in eventbridge_buses.go/eventbridge_tags.go: terraform-provider-aws #31634 and #22131, serverless #8479, pulumi-aws stepfunctions: GetExecutionHistory renders timestamp as RFC3339 and emits two unpublished event types #1323, and Stack Overflow 76683058 and 76065443. The other messages are substrate's own. The code for refusing to delete the default bus (ValidationException) is what moto and Floci answer, and its message is substrate's own.

Routed-operation catalog: from 1,128 to 1,137 (+9: CreateEventBus, DescribeEventBus, UpdateEventBus, DeleteEventBus, PutPermission, RemovePermission, EnableRule, DisableRule, ListRuleNamesByTarget). The wire-model snapshot was re-fetched (events.json.gz, manifest.json, wire_model_gen.go).

Gates run locally:

  • make lint test e2e;
  • Service Reference Drift (operation-catalog-check docs-reference-check docs-headings-check operation-docs-check authz-reference-check cfn-schema-check wire-model-check scheduler-query-model-check doc-links-check);
  • Wire Bookkeeping Drift (wire-bookkeeping-check discarded-* nondeterminism-check comment-history-check);
  • docs-versions docs-counts-check;
  • SUBSTRATE_IAC=1 make iac-e2e;
  • VitePress build.

Terraform scratch check against a built binary, with provider 6.73.0:

  • The config was aws_cloudwatch_event_bus, a rule on it, aws_cloudwatch_event_target, aws_cloudwatch_event_permission, a second bus with aws_cloudwatch_event_bus_policy, and a default-bus rule.
  • Apply succeeded, and the second plan was empty.
  • An in-place description/tag update applied, then planned empty.
  • Destroy succeeded.

Follow-up filed: #1697 (CFN rule Targets and in-place updates, PutTargets quotas, PutEvents to an absent bus, ListTargetsByRule paging).

@scttfrdmn scttfrdmn added this to the v0.134.0 milestone Nov 24, 2026
@scttfrdmn scttfrdmn added type: feature New feature or improvement area: eventbridge Amazon EventBridge labels Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.03480% with 72 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
emulator/cfn_resources_events.go 86.80% 43 Missing ⚠️
emulator/eventbridge_buses.go 96.49% 15 Missing ⚠️
emulator/eventbridge_tags.go 94.41% 10 Missing ⚠️
emulator/eventbridge_plugin.go 98.38% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

area: eventbridge Amazon EventBridge type: feature New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tagging API: TagResources/UntagResources on EventBridge rule ARNs

1 participant