Skip to content

Commit 5b0fd70

Browse files
authored
Merge branch 'main' into dependabot/bundler/docs/nokogiri-1.19.1
2 parents 034ebda + 2a91bed commit 5b0fd70

99 files changed

Lines changed: 6050 additions & 5045 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This repository documents the Supplier API specification and provides an SDK wit
3434
- [CI (Automatic)](#ci-automatic)
3535
- [CD (Manual)](#cd-manual)
3636
- [Licence](#licence)
37+
- [Postman](#postman)
3738

3839
## API Consumers - Getting Started
3940

@@ -138,3 +139,15 @@ Deployments can be made of any [release](https://github.com/NHSDigital/nhs-notif
138139
Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.
139140

140141
Any HTML or Markdown documentation is [© Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).
142+
143+
## Postman
144+
145+
Included in this repo are postman collections that allows the user to interact with the sandbox APIs.
146+
147+
To use the collections:
148+
149+
Download the json files located in the postman directory
150+
Import the files into postman
151+
Select a target environment in postman
152+
Run the collection
153+
The collections must be kept in sync manually

docs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"nhsuk-frontend": "^10.1.0"
55
},
66
"description": "",
7-
"devDependencies": {},
87
"engines": {},
98
"keywords": [],
109
"license": "ISC",

eslint.config.mjs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,31 @@ import {
2020
} from 'eslint-config-airbnb-extended';
2121
import { rules as prettierConfigRules } from 'eslint-config-prettier';
2222

23-
import { dirname } from 'node:path';
23+
import { readFileSync } from 'node:fs';
24+
import { dirname, resolve } from 'node:path';
2425
import { fileURLToPath } from 'node:url';
2526
import { FlatCompat } from '@eslint/eslintrc';
27+
import { globSync } from 'glob';
2628

2729
const __filename = fileURLToPath(import.meta.url);
2830
const __dirname = dirname(__filename);
2931

32+
const rootPackageJson = JSON.parse(
33+
readFileSync(new URL('./package.json', import.meta.url), 'utf8'),
34+
);
35+
const workspacePatterns = rootPackageJson.workspaces ?? [];
36+
const workspacePackageDirs = workspacePatterns.flatMap((pattern) =>
37+
globSync(`${pattern}/package.json`, {
38+
cwd: __dirname,
39+
ignore: ['**/node_modules/**'],
40+
}).map((packageJsonPath) =>
41+
resolve(__dirname, packageJsonPath.replace(/\/package\.json$/, '')),
42+
),
43+
);
44+
const monorepoPackageDirs = Array.from(
45+
new Set([__dirname, ...workspacePackageDirs]),
46+
);
47+
3048
const compat = new FlatCompat({
3149
baseDirectory: __dirname,
3250
});
@@ -171,7 +189,7 @@ export default defineConfig([
171189
rules: {
172190
'import-x/no-extraneous-dependencies': [
173191
2,
174-
{ devDependencies: true },
192+
{ devDependencies: true, packageDir: monorepoPackageDirs },
175193
],
176194
},
177195
},
@@ -188,7 +206,7 @@ export default defineConfig([
188206
rules: {
189207
'import-x/no-extraneous-dependencies': [
190208
'error',
191-
{ devDependencies: true },
209+
{ devDependencies: true, packageDir: monorepoPackageDirs },
192210
],
193211
},
194212
},

infrastructure/terraform/components/api/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ No requirements.
1717
| <a name="input_core_environment"></a> [core\_environment](#input\_core\_environment) | Environment of Core | `string` | `"prod"` | no |
1818
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
1919
| <a name="input_disable_gateway_execute_endpoint"></a> [disable\_gateway\_execute\_endpoint](#input\_disable\_gateway\_execute\_endpoint) | Disable the execution endpoint for the API Gateway | `bool` | `true` | no |
20+
| <a name="input_enable_alarms"></a> [enable\_alarms](#input\_enable\_alarms) | Enable CloudWatch alarms for this deployed environment | `bool` | `true` | no |
2021
| <a name="input_enable_api_data_trace"></a> [enable\_api\_data\_trace](#input\_enable\_api\_data\_trace) | Enable API Gateway data trace logging | `bool` | `false` | no |
2122
| <a name="input_enable_backups"></a> [enable\_backups](#input\_enable\_backups) | Enable backups | `bool` | `false` | no |
2223
| <a name="input_enable_event_cache"></a> [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `true` | no |
@@ -46,6 +47,10 @@ No requirements.
4647
| <a name="module_amendment_event_transformer"></a> [amendment\_event\_transformer](#module\_amendment\_event\_transformer) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
4748
| <a name="module_amendments_queue"></a> [amendments\_queue](#module\_amendments\_queue) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4849
| <a name="module_authorizer_lambda"></a> [authorizer\_lambda](#module\_authorizer\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
50+
| <a name="module_ddb_alarms_letter_queue"></a> [ddb\_alarms\_letter\_queue](#module\_ddb\_alarms\_letter\_queue) | ../../modules/alarms-ddb | n/a |
51+
| <a name="module_ddb_alarms_letters"></a> [ddb\_alarms\_letters](#module\_ddb\_alarms\_letters) | ../../modules/alarms-ddb | n/a |
52+
| <a name="module_ddb_alarms_mi"></a> [ddb\_alarms\_mi](#module\_ddb\_alarms\_mi) | ../../modules/alarms-ddb | n/a |
53+
| <a name="module_ddb_alarms_suppliers"></a> [ddb\_alarms\_suppliers](#module\_ddb\_alarms\_suppliers) | ../../modules/alarms-ddb | n/a |
4954
| <a name="module_domain_truststore"></a> [domain\_truststore](#module\_domain\_truststore) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-s3bucket.zip | n/a |
5055
| <a name="module_eventpub"></a> [eventpub](#module\_eventpub) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.31/terraform-eventpub.zip | n/a |
5156
| <a name="module_eventsub"></a> [eventsub](#module\_eventsub) | ../../modules/eventsub | n/a |
@@ -54,6 +59,7 @@ No requirements.
5459
| <a name="module_get_letters"></a> [get\_letters](#module\_get\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
5560
| <a name="module_get_status"></a> [get\_status](#module\_get\_status) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
5661
| <a name="module_kms"></a> [kms](#module\_kms) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-kms.zip | n/a |
62+
| <a name="module_lambda_alarms"></a> [lambda\_alarms](#module\_lambda\_alarms) | ../../modules/alarms-lambda | n/a |
5763
| <a name="module_letter_status_updates_queue"></a> [letter\_status\_updates\_queue](#module\_letter\_status\_updates\_queue) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
5864
| <a name="module_letter_updates_transformer"></a> [letter\_updates\_transformer](#module\_letter\_updates\_transformer) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
5965
| <a name="module_logging_bucket"></a> [logging\_bucket](#module\_logging\_bucket) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-s3bucket.zip | n/a |
@@ -62,10 +68,12 @@ No requirements.
6268
| <a name="module_post_letters"></a> [post\_letters](#module\_post\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
6369
| <a name="module_post_mi"></a> [post\_mi](#module\_post\_mi) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
6470
| <a name="module_s3bucket_test_letters"></a> [s3bucket\_test\_letters](#module\_s3bucket\_test\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-s3bucket.zip | n/a |
71+
| <a name="module_sqs_alarms"></a> [sqs\_alarms](#module\_sqs\_alarms) | ../../modules/alarms-sqs | n/a |
6572
| <a name="module_sqs_letter_updates"></a> [sqs\_letter\_updates](#module\_sqs\_letter\_updates) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-sqs.zip | n/a |
6673
| <a name="module_sqs_supplier_allocator"></a> [sqs\_supplier\_allocator](#module\_sqs\_supplier\_allocator) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-sqs.zip | n/a |
6774
| <a name="module_supplier_allocator"></a> [supplier\_allocator](#module\_supplier\_allocator) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
6875
| <a name="module_supplier_ssl"></a> [supplier\_ssl](#module\_supplier\_ssl) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-ssl.zip | n/a |
76+
| <a name="module_update_letter_queue"></a> [update\_letter\_queue](#module\_update\_letter\_queue) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
6977
| <a name="module_upsert_letter"></a> [upsert\_letter](#module\_upsert\_letter) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip | n/a |
7078
## Outputs
7179

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
resource "aws_cloudwatch_metric_alarm" "apigw_five_xx" {
2+
count = local.alarms_enabled ? 1 : 0
3+
4+
alarm_name = "${local.csi}-apigw-5xx"
5+
alarm_description = "RELIABILITY: API Gateway 5xx responses"
6+
7+
namespace = "AWS/ApiGateway"
8+
metric_name = "5XXError"
9+
statistic = "Sum"
10+
period = 60
11+
12+
evaluation_periods = 1
13+
threshold = 0
14+
comparison_operator = "GreaterThanThreshold"
15+
treat_missing_data = "notBreaching"
16+
17+
dimensions = local.apigw_alarm_dimensions
18+
19+
actions_enabled = false
20+
alarm_actions = []
21+
ok_actions = []
22+
insufficient_data_actions = []
23+
tags = local.default_tags
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
resource "aws_cloudwatch_metric_alarm" "apigw_latency_anomaly" {
2+
count = local.alarms_enabled ? 1 : 0
3+
4+
alarm_name = "${local.csi}-apigw-latency-anomaly"
5+
alarm_description = "RELIABILITY: API Gateway latency anomaly"
6+
comparison_operator = "GreaterThanUpperThreshold"
7+
evaluation_periods = 5
8+
datapoints_to_alarm = 3
9+
threshold_metric_id = "ad1"
10+
treat_missing_data = "notBreaching"
11+
12+
actions_enabled = false
13+
alarm_actions = []
14+
ok_actions = []
15+
insufficient_data_actions = []
16+
tags = local.default_tags
17+
18+
metric_query {
19+
id = "m1"
20+
metric {
21+
metric_name = "Latency"
22+
namespace = "AWS/ApiGateway"
23+
stat = "Average"
24+
period = 60
25+
dimensions = local.apigw_alarm_dimensions
26+
}
27+
return_data = true
28+
}
29+
30+
metric_query {
31+
id = "ad1"
32+
expression = "ANOMALY_DETECTION_BAND(m1, 2)"
33+
label = "Latency (expected)"
34+
return_data = true
35+
}
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
resource "aws_cloudwatch_metric_alarm" "apigw_latency_threshold" {
2+
count = local.alarms_enabled ? 1 : 0
3+
4+
alarm_name = "${local.csi}-apigw-latency-threshold"
5+
alarm_description = "RELIABILITY: API Gateway latency above threshold"
6+
7+
namespace = "AWS/ApiGateway"
8+
metric_name = "Latency"
9+
statistic = "Average"
10+
period = 60
11+
12+
evaluation_periods = 5
13+
threshold = 29000
14+
comparison_operator = "GreaterThanThreshold"
15+
treat_missing_data = "notBreaching"
16+
17+
dimensions = local.apigw_alarm_dimensions
18+
19+
actions_enabled = false
20+
alarm_actions = []
21+
ok_actions = []
22+
insufficient_data_actions = []
23+
tags = local.default_tags
24+
}

infrastructure/terraform/components/api/cloudwatch_metric_alarm_apim_auth_cert_expirty.tf renamed to infrastructure/terraform/components/api/cloudwatch_metric_alarm_apim_auth_cert_expiry.tf

File renamed without changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
resource "aws_dynamodb_table" "letter_queue" {
2+
name = "${local.csi}-letter-queue"
3+
billing_mode = "PAY_PER_REQUEST"
4+
5+
hash_key = "supplierId"
6+
range_key = "queueTimestamp"
7+
8+
ttl {
9+
attribute_name = "ttl"
10+
enabled = true
11+
}
12+
13+
local_secondary_index {
14+
name = "letterId-index"
15+
range_key = "letterId"
16+
projection_type = "ALL"
17+
}
18+
19+
attribute {
20+
name = "supplierId"
21+
type = "S"
22+
}
23+
24+
attribute {
25+
name = "letterId"
26+
type = "S"
27+
}
28+
29+
attribute {
30+
name = "queueTimestamp"
31+
type = "S"
32+
}
33+
34+
point_in_time_recovery {
35+
enabled = true
36+
}
37+
38+
tags = merge(
39+
local.default_tags,
40+
{
41+
NHSE-Enable-Dynamo-Backup-Acct = "True"
42+
}
43+
)
44+
}

infrastructure/terraform/components/api/event_source_mapping_status_updates_to_handler.tf

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)