Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5f7faf8
NPT-937 Create VPC Endpoints for managing traffic between SAET platfo…
soji-kainos-nhs-temp Mar 3, 2026
382820e
NPT-937 Add Policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
06402de
NPT-937 Add Policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
64e0cce
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
d4b4787
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
a623601
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
e12dcdf
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
356c087
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
ceb22d9
NPT-937 Add policies to VPC Endpoints
soji-kainos-nhs-temp Mar 4, 2026
d17a7c7
NPT-1102 Resolve checkov top level permission error
soji-kainos-nhs-temp Mar 4, 2026
3f6b949
NPT-1102 Resolve checkov top level permission error
soji-kainos-nhs-temp Mar 4, 2026
5dfae6f
NPT-1135: Fixing the cleardown script
JackCullen-nhs Mar 5, 2026
ebbe151
NPT-1135: Fixing the cleardown script
JackCullen-nhs Mar 5, 2026
304237a
NPT-1135: Fixing the cleardown script
JackCullen-nhs Mar 5, 2026
fb7d75e
NPT-1135: Fixing the cleardown script
JackCullen-nhs Mar 5, 2026
5d612da
NPT-1135: Fixing the cleardown script
JackCullen-nhs Mar 5, 2026
9c70964
NPT-951: Adding monitoring to the Dynamodb
JackCullen-nhs Mar 6, 2026
705ef25
NPT-1102 Resolve Checkov top level write permission issues
soji-kainos-nhs-temp Mar 5, 2026
52025ee
NPT-1102 Resolve Checkov top level write permission issues
soji-kainos-nhs-temp Mar 5, 2026
cbfb7dd
NPT-1102 Resolve Checkov which sets maxItem to requestBody array
soji-kainos-nhs-temp Mar 5, 2026
68da6af
NPT-1102 Resolve Checkov which sets maxItem to requestBody array
soji-kainos-nhs-temp Mar 5, 2026
cbb5b48
NPT-1102 Resolve Checkov which sets maxItem to requestBody array
soji-kainos-nhs-temp Mar 5, 2026
1a4193e
NPT-1102 Allow temporary deployment from develop branch to dev enviro…
soji-kainos-nhs-temp Mar 5, 2026
1faaee8
NPT-1102 Allow temporary deployment from develop branch to dev enviro…
soji-kainos-nhs-temp Mar 5, 2026
196dd6c
NPT-937 Add appropriate matrix stacks for apply account infra job
soji-kainos-nhs-temp Mar 5, 2026
3c51b4b
NPT-937 Amend github runner permission policies
soji-kainos-nhs-temp Mar 5, 2026
9fc84d2
NPT-937 Amend github runner permission policies
soji-kainos-nhs-temp Mar 5, 2026
e0f4e46
_ping endpoint implementation
MaciejKaczor-nhs Mar 6, 2026
e1c9f27
NPT-1107: update _ping endpoint to working version
MaciejKaczor-nhs Mar 6, 2026
dfb6c1f
NPT-1140 Amend NHS pathway file uploader s3 bucket name
soji-kainos-nhs-temp Mar 9, 2026
65202db
NPT-1140 Amend NHS pathway file uploader s3 bucket name
soji-kainos-nhs-temp Mar 9, 2026
1f1305e
NPT-1140 Amend NHS pathway file uploader s3 bucket name
soji-kainos-nhs-temp Mar 9, 2026
599c28d
NPT-1140 Amend NHS pathway file uploader s3 bucket name
soji-kainos-nhs-temp Mar 9, 2026
f269d96
NPT-1140 Amend artefact management bucket policy principal to account…
soji-kainos-nhs-temp Mar 9, 2026
5dc8a70
NPT-1140 Amend artefact management bucket policy principal to account…
soji-kainos-nhs-temp Mar 9, 2026
14751b3
NPT-1107: create _status endpoint
MaciejKaczor-nhs Mar 10, 2026
9d4712c
NPT-951: Adding monitoring to the Dynamodb
JackCullen-nhs Mar 10, 2026
4b0d297
NPT-1140 Deploy infra in INT env and amend artefact s3 bucket principals
soji-kainos-nhs-temp Mar 10, 2026
6e93517
NPT-1140 Amend artefact mgmt S3 bucket principal identifier to conta…
soji-kainos-nhs-temp Mar 10, 2026
a5dbcbf
NPT-1140 Amend artefact mgmt S3 bucket principal identifier to conta…
soji-kainos-nhs-temp Mar 10, 2026
f7b20a7
NPT-1140 Amend artefact mgmt S3 bucket principal identifier to conta…
soji-kainos-nhs-temp Mar 10, 2026
ee96bc3
NPT-1140 Amend action infra stack script to remove reference to unuse…
soji-kainos-nhs-temp Mar 10, 2026
8fa16d8
NPT-1140 Amend action infra stack script to remove reference to unuse…
soji-kainos-nhs-temp Mar 10, 2026
ddf99df
Integrates with Odin via a new lambda reading log events from the APIG
anwa-nhs Mar 6, 2026
d91785f
NPT-1140 Include missing Github runner policy actions
soji-kainos-nhs-temp Mar 10, 2026
c556707
NPT-951: DynamoDB_Logging
JackCullen-nhs Mar 11, 2026
9d66779
NPT-951: DynamoDB_Logging
JackCullen-nhs Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions/cleardown-tf-state/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Cleardown terraform state action"
description: "Delete the terraform state"
inputs:
workspace:
description: "The name of the workspace to action the infrastructure into."
required: true
environment:
description: "The name of the environment to action the infrastructure into."
required: true
stack:
description: "A single variable for the stack to be cleared."
required: true

runs:
using: composite
steps:
- name: Delete terraform state
id: delete_tf_state
shell: bash
env:
WORKSPACE: ${{ inputs.workspace }}
ENVIRONMENT: ${{ inputs.environment }}
STACK: ${{ inputs.stack }}
run: |
./scripts/workflow/cleardown-terraform-state.sh
7 changes: 7 additions & 0 deletions .github/workflows/artefacts-cleardown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ on:
description: "The type of permissions (e.g., account, app)"
required: true
type: string
secrets:
ACCOUNT_ID:
description: "AWS account ID for credentials"
required: true
MGMT_ACCOUNT_ID:
description: "AWS management account ID for credentials"
required: false

jobs:
cleardown-artefacts:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/infrastructure-cleardown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ on:
description: "The type of permissions (e.g., account, app)"
required: true
type: string
secrets:
ACCOUNT_ID:
description: "AWS account ID for credentials"
required: true
MGMT_ACCOUNT_ID:
description: "AWS management account ID for credentials"
required: true

jobs:
destroy-application-infrastructure:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pipeline-infrastructure-cleardown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ on:
description: "Specify the workspace to cleardown"
required: true
type: string

jobs:
metadata:
if: github.actor != 'github-merge-queue[bot]'
if: >-
github.actor != 'github-merge-queue[bot]' &&
(
github.event_name != 'delete' ||
(
github.event.ref_type == 'branch' &&
(startsWith(github.event.ref, 'task/') || startsWith(github.event.ref, 'dependabot/'))
)
)
name: "Get Metadata"
uses: ./.github/workflows/metadata.yaml

Expand All @@ -49,7 +56,7 @@ jobs:
with:
environment: ${{ github.event.client_payload.environment || inputs.environment || needs.metadata.outputs.environment }}
workspace: ${{ github.event.client_payload.workspace || inputs.workspace || needs.metadata.outputs.workspace }}
stacks: "['triage]"
stacks: "['triage']"
application_tag: ${{ inputs.application_tag || github.event.client_payload.application_tag || 'latest' }}
commit_hash: ${{ needs.metadata.outputs.commit_hash }}
workflow_timeout: 30
Expand Down
49 changes: 49 additions & 0 deletions infrastructure/stacks/triage/alarms.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
locals {
dynamodb_alarm_table_names = {
starting_coords = module.starting_coords.dynamodb_table_name
triage_nodes = module.triage_nodes.dynamodb_table_name
bodymaps = module.bodymaps.dynamodb_table_name
}
}

resource "aws_cloudwatch_metric_alarm" "dynamodb_system_errors" {
for_each = var.enable_dynamodb_basic_alarms ? local.dynamodb_alarm_table_names : {}

alarm_name = "${local.resource_prefix}-${each.key}-dynamodb-system-errors${local.workspace_suffix}"
alarm_description = "DynamoDB system errors detected for ${each.value}"
namespace = "AWS/DynamoDB"
metric_name = "SystemErrors"
statistic = "Sum"
period = var.dynamodb_alarm_period_seconds
evaluation_periods = var.dynamodb_alarm_evaluation_periods
threshold = var.dynamodb_system_errors_threshold
comparison_operator = "GreaterThanThreshold"
treat_missing_data = "notBreaching"
alarm_actions = var.dynamodb_alarm_actions
ok_actions = var.dynamodb_alarm_ok_actions

dimensions = {
TableName = each.value
}
}

resource "aws_cloudwatch_metric_alarm" "dynamodb_throttled_requests" {
for_each = var.enable_dynamodb_basic_alarms ? local.dynamodb_alarm_table_names : {}

alarm_name = "${local.resource_prefix}-${each.key}-dynamodb-throttled-requests${local.workspace_suffix}"
alarm_description = "DynamoDB throttled requests detected for ${each.value}"
namespace = "AWS/DynamoDB"
metric_name = "ThrottledRequests"
statistic = "Sum"
period = var.dynamodb_alarm_period_seconds
evaluation_periods = var.dynamodb_alarm_evaluation_periods
threshold = var.dynamodb_throttled_requests_threshold
comparison_operator = "GreaterThanThreshold"
treat_missing_data = "notBreaching"
alarm_actions = var.dynamodb_alarm_actions
ok_actions = var.dynamodb_alarm_ok_actions

dimensions = {
TableName = each.value
}
}
2 changes: 1 addition & 1 deletion infrastructure/stacks/triage/s3.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "clinical_data_uploader_bucket" {
source = "../../modules/s3"
bucket_name = "${local.account_prefix}-clinical-data-uploader"
bucket_name = "${local.account_prefix}-clinical-data-uploader-${local.workspace_suffix}"
}
44 changes: 44 additions & 0 deletions infrastructure/stacks/triage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ variable "log_retention_days" {
description = "Number of days to retain CloudWatch logs for API Gateway access logs"
type = number
default = 365
default = 365
}

# API Gateway X-Ray Tracing
Expand All @@ -71,3 +72,46 @@ variable "splunk_hec_token" {
type = string
default = ""
}

# DynamoDB basic alarms
variable "enable_dynamodb_basic_alarms" {
description = "Enable basic CloudWatch alarms for DynamoDB table health metrics"
type = bool
default = true
}

variable "dynamodb_alarm_actions" {
description = "List of ARNs for CloudWatch alarm actions (for example SNS topic ARNs)"
type = list(string)
default = []
}

variable "dynamodb_alarm_ok_actions" {
description = "List of ARNs for CloudWatch OK actions"
type = list(string)
default = []
}

variable "dynamodb_alarm_period_seconds" {
description = "Period in seconds over which DynamoDB alarm metrics are evaluated"
type = number
default = 300
}

variable "dynamodb_alarm_evaluation_periods" {
description = "Number of periods over which data is compared to alarm threshold"
type = number
default = 1
}

variable "dynamodb_system_errors_threshold" {
description = "Threshold for the DynamoDB SystemErrors alarm"
type = number
default = 0
}

variable "dynamodb_throttled_requests_threshold" {
description = "Threshold for the DynamoDB ThrottledRequests alarm"
type = number
default = 0
}
9 changes: 3 additions & 6 deletions scripts/githooks/check-commit-message.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ function check_jira_ref {
fi

echo $COMMIT_MESSAGE
return
return 0
}

function check_commit_message_format {
COMMIT_MESSAGE="$1"
local regex='^(feat|fix|chore|docs|style|refactor|perf|test|ci|build|revert|style)(\([a-z0-9_-]+\))?: (SAET)-[0-9]+ .+'
local REGEX='^(feat|fix|chore|docs|style|refactor|perf|test|ci|build|revert|style)(\([a-z0-9_-]+\))?: (SAET)-[0-9]+ .+'

if ! [[ $COMMIT_MESSAGE =~ $regex ]]; then
if ! [[ $COMMIT_MESSAGE =~ $REGEX ]]; then
echo -e "\033[0;31mInvalid conventional commit message format! Expected: <type>(<scope>): <JIRA-1234> <Description>\033[0m"
return 1
fi
return
}

function check_commit_message_length {
Expand All @@ -41,7 +40,6 @@ function check_commit_message_length {
if [[ "$COMMIT_MESSAGE_LENGTH" -gt $GIT_COMMIT_MESSAGE_MAX_LENGTH ]] ; then
echo "At $COMMIT_MESSAGE_LENGTH characters the commit message exceeds limit of $GIT_COMMIT_MESSAGE_MAX_LENGTH"
fi
return
}

function check_git_commit_message {
Expand All @@ -55,7 +53,6 @@ function check_git_commit_message {
[[ ! -z "$VALID_LENGTH" ]] && echo $VALID_LENGTH
return 1
fi
return
}

# ---- MAIN EXECUTION ----
Expand Down
Loading
Loading