Skip to content

BCSS-23565 create terraform module WAF#55

Draft
DeepikaDK001 wants to merge 3 commits into
mainfrom
feature/BCSS-23565-create-terraform-module-WAF
Draft

BCSS-23565 create terraform module WAF#55
DeepikaDK001 wants to merge 3 commits into
mainfrom
feature/BCSS-23565-create-terraform-module-WAF

Conversation

@DeepikaDK001

Copy link
Copy Markdown
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@DeepikaDK001 DeepikaDK001 marked this pull request as ready for review June 11, 2026 09:10
@DeepikaDK001 DeepikaDK001 requested review from a team as code owners June 11, 2026 09:10
@nhs-oliverslater nhs-oliverslater added enhancement New feature or request terraform Pull request that updates terraform code / modules labels Jun 16, 2026

@nhs-oliverslater nhs-oliverslater left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for your work on this. As per below comments, theres no need to maintain strict compatibility or even consider the existing legacy code (except for ensuring the module can support the same rule types etc).

If you can please refactor to remove any reference to legacy modules, remove explicit rules in the module, ensure that consumer level rules can be passed in and theres no conflict with rule ids etc.

As opposed to building raw resources directly, can you instead wrap the recommended module with appropriate defaults and overrides, allowing consumer level input to pass in rules/rulegroups. @Pira-nhs has some good examples on what sort of things should be included and there is also a Copilot skill setup called /new-terraform-module that should get you started.

With respect of outside resources i.e. Log groups, SNS topics etc - ideally, these should not be created by THIS module but instead by their respective module and either (give users both options) to create within this module but making a cross module reference, or built at the consumer layer and passed in as an ARN.

Additionally, ensure you store locals in locals.tf, data sources in data.tf etc and have README.md with documentation - examples of this can be found in the acm module for a simple example, moving up to the VPC module (on branch at present) for a more complex example.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ruleset should be passed in by consumer, not defined in module

"aws-waf-logs-${local.derived_name_prefix}"
)

enable_legacy_bcss_mode = var.enable_legacy_bcss_mode != null ? var.enable_legacy_bcss_mode : anytrue([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isnt needed - we're creating resources afresh - feel free to drop this and write elsewhere to keep this aligned with upstream module inputs only

enable_splunk_logging_subscription = var.enable_splunk_logging_subscription != null ? var.enable_splunk_logging_subscription : local.enable_legacy_bcss_mode
enable_shield_ddos_alarming = var.enable_shield_ddos_alarming != null ? var.enable_shield_ddos_alarming : local.enable_legacy_bcss_mode

waf_ips_secret_name = coalesce(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isnt needed - we're creating resources afresh - feel free to drop this and write elsewhere to keep this aligned with upstream module inputs only

@nhs-oliverslater nhs-oliverslater marked this pull request as draft June 23, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request terraform Pull request that updates terraform code / modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants