Skip to content

feat(eventbridge): BCSS-24132 - Add terraform-aws-modules/terraform-aws-eventbridge wrapper - #119

Open
dave4420 wants to merge 65 commits into
mainfrom
feature/BCSS-24132-wrap-eventbridge
Open

dave4420 wants to merge 65 commits into
mainfrom
feature/BCSS-24132-wrap-eventbridge

Conversation

@dave4420

@dave4420 dave4420 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

@dave4420
dave4420 marked this pull request as ready for review September 28, 2026 09:21
@dave4420
dave4420 requested review from a team and saliceti as code owners September 28, 2026 09:21
@nhs-oliverslater
nhs-oliverslater requested a lite review from Copilot September 28, 2026 16:35
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved correctness and security issues include null resource names, wildcard KMS permissions, and unprotected credential inputs.

Review effort: Lite
Findings: 3 High severity · 1 Medium severity · 3 Low severity

Open (7)
What changed in this PR

Adds an NHS Terraform wrapper for AWS EventBridge and EventBridge Scheduler with shared naming, tagging, KMS configuration, outputs, documentation, and dependency management.

Changes:

  • Adds EventBridge wrapper configuration, inputs, locals, outputs, and context.
  • Adds Terraform/provider constraints and lock data.
  • Updates module documentation, catalogue, and Dependabot configuration.
File Summary
README.md Updates the available-modules catalogue.
infrastructure/​modules/​eventbridge/​versions.tf Defines Terraform and provider constraints.
infrastructure/​modules/​eventbridge/​variables.tf Defines wrapper inputs and validations.
infrastructure/​modules/​eventbridge/​README.md Documents the EventBridge wrapper.
infrastructure/​modules/​eventbridge/​outputs.tf Exposes EventBridge outputs.
infrastructure/​modules/​eventbridge/​main.tf Configures the upstream EventBridge module.
infrastructure/​modules/​eventbridge/​locals.tf Implements naming and configuration transformations.
infrastructure/​modules/​eventbridge/​context.tf Provides shared context integration.
infrastructure/​modules/​eventbridge/​.terraform.lock.hcl Locks AWS provider dependencies.
.github/​dependabot.yaml Enables Dependabot coverage.
Files not reviewed (1)
  • infrastructure/modules/eventbridge/.terraform.lock.hcl: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread infrastructure/modules/eventbridge/locals.tf
Comment thread infrastructure/modules/eventbridge/variables.tf
Comment thread infrastructure/modules/eventbridge/variables.tf Outdated
Comment thread infrastructure/modules/eventbridge/main.tf Outdated
Comment thread README.md Outdated
Comment thread infrastructure/modules/eventbridge/README.md
Comment thread infrastructure/modules/eventbridge/main.tf

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread infrastructure/modules/eventbridge/variables.tf Outdated
Comment thread infrastructure/modules/eventbridge/variables.tf Outdated
Comment thread infrastructure/modules/eventbridge/locals.tf Outdated
Comment thread infrastructure/modules/eventbridge/variables.tf Outdated
Comment thread infrastructure/modules/eventbridge/variables.tf Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread infrastructure/modules/eventbridge/locals.tf Outdated
Comment thread infrastructure/modules/eventbridge/locals.tf
Comment thread infrastructure/modules/eventbridge/validations.tf Outdated
Comment thread infrastructure/modules/eventbridge/variables.tf Outdated
Comment thread infrastructure/modules/eventbridge/README.md
Comment thread infrastructure/modules/eventbridge/README.md Outdated
Comment thread infrastructure/modules/eventbridge/main.tf

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The default invocation fails when evaluating the nullable enabled input, alongside unresolved API and source-version issues.

Review effort: Balanced
Findings: 1 High severity · 3 Low severity

Open (4)
Resolved since last review (6)
Files not reviewed (1)
  • infrastructure/modules/eventbridge/.terraform.lock.hcl: Generated file

Comment thread infrastructure/modules/eventbridge/locals.tf Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Disabled and bus-less configurations currently fail because of the bus-name expression and unconditional KMS input.

Review effort: Balanced
Findings: 1 High severity · 2 Low severity

Open (3)
Resolved since last review (2)
Files not reviewed (1)
  • infrastructure/modules/eventbridge/.terraform.lock.hcl: Generated file
Previously missed (1)

In code that hasn't changed since last review

Low severity Remove unsupported resources from the naming enforcement claim

infrastructure/​modules/​eventbridge/​README.md:41

This enforcement claim contradicts the wrapper's explicit removal of connections and API destinations: neither resource has a creation input, so their names cannot be scoped here. Remove those resource types from the naming claim.

Comment thread infrastructure/modules/eventbridge/locals.tf Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Schema discovery and schedule-group naming can currently cause apply failures.

Review effort: Balanced
Findings: 2 High severity · 1 Low severity

Open (3)
Resolved since last review (2)
Files not reviewed (1)
  • infrastructure/modules/eventbridge/.terraform.lock.hcl: Generated file
Previously missed (1)

In code that hasn't changed since last review

Low severity Document required KMS key when creating the bus

infrastructure/​modules/​eventbridge/​README.md:116

The Validation section documents the SNS precondition but omits the other precondition in validations.tf: kms_key_identifier must be non-empty when create_bus is enabled. Add it here so callers can discover all enforced cross-variable constraints before planning.

? merge(
v,
{
group_name = local.schedule_groups[v.group_name].name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't true. We are using this with https://github.com/NHSDigital/bcss/pull/590 and it works fine.

event_source_name = var.event_source_name
kms_key_identifier = var.kms_key_identifier
dead_letter_config = var.dead_letter_config
schemas_discoverer_description = var.schemas_discoverer_description

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The pinned upstream module defaults create_schemas_discoverer to false.

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.

3 participants