Skip to content

Commit 2e08b1f

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/CCM-9873_cloudfront-distro
2 parents 076a1cf + 2c0c7f5 commit 2e08b1f

38 files changed

+134
-94
lines changed

frontend/src/__tests__/components/forms/LetterTemplateForm.test.tsx/LetterTemplateForm.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test('renders page with preloaded field values', () => {
2929
initialState={mockDeep<TemplateFormState<LetterTemplate>>({
3030
validationError: undefined,
3131
name: 'template-name',
32-
letterType: 'q1',
32+
letterType: 'x1',
3333
language: 'ar',
3434
})}
3535
/>

frontend/src/__tests__/components/forms/LetterTemplateForm.test.tsx/__snapshots__/LetterTemplateForm.test.tsx.snap

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,6 @@ exports[`Client-side validation triggers 1`] = `
190190
id="letterTemplateLetterType"
191191
name="letterTemplateLetterType"
192192
>
193-
<option
194-
value="x3"
195-
>
196-
Audio CD
197-
</option>
198-
<option
199-
value="q1"
200-
>
201-
Braille
202-
</option>
203193
<option
204194
value="q4"
205195
>
@@ -690,16 +680,6 @@ exports[`renders page one error 1`] = `
690680
id="letterTemplateLetterType"
691681
name="letterTemplateLetterType"
692682
>
693-
<option
694-
value="x3"
695-
>
696-
Audio CD
697-
</option>
698-
<option
699-
value="q1"
700-
>
701-
Braille
702-
</option>
703683
<option
704684
value="q4"
705685
>
@@ -1200,16 +1180,6 @@ exports[`renders page with multiple errors 1`] = `
12001180
id="letterTemplateLetterType"
12011181
name="letterTemplateLetterType"
12021182
>
1203-
<option
1204-
value="x3"
1205-
>
1206-
Audio CD
1207-
</option>
1208-
<option
1209-
value="q1"
1210-
>
1211-
Braille
1212-
</option>
12131183
<option
12141184
value="q4"
12151185
>
@@ -1653,23 +1623,13 @@ exports[`renders page with preloaded field values 1`] = `
16531623
id="letterTemplateLetterType"
16541624
name="letterTemplateLetterType"
16551625
>
1656-
<option
1657-
value="x3"
1658-
>
1659-
Audio CD
1660-
</option>
1661-
<option
1662-
selected=""
1663-
value="q1"
1664-
>
1665-
Braille
1666-
</option>
16671626
<option
16681627
value="q4"
16691628
>
16701629
British Sign Language
16711630
</option>
16721631
<option
1632+
selected=""
16731633
value="x1"
16741634
>
16751635
Large print

frontend/src/__tests__/components/forms/LetterTemplateForm.test.tsx/server-action.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('CreateLetterTemplate server actions', () => {
4848
id: 'new-template-id',
4949
templateStatus: 'NOT_YET_SUBMITTED',
5050
name: 'template-name',
51-
letterType: 'q1',
51+
letterType: 'x1',
5252
language: 'ar',
5353
files: {
5454
pdfTemplate: {
@@ -77,7 +77,7 @@ describe('CreateLetterTemplate server actions', () => {
7777
initialState,
7878
getMockFormData({
7979
letterTemplateName: 'template-name',
80-
letterTemplateLetterType: 'q1',
80+
letterTemplateLetterType: 'x1',
8181
letterTemplateLanguage: 'ar',
8282
letterTemplatePdf,
8383
letterTemplateCsv,
@@ -88,7 +88,7 @@ describe('CreateLetterTemplate server actions', () => {
8888
{
8989
...initialState,
9090
name: 'template-name',
91-
letterType: 'q1',
91+
letterType: 'x1',
9292
language: 'ar',
9393
},
9494
letterTemplatePdf,
@@ -107,7 +107,7 @@ describe('CreateLetterTemplate server actions', () => {
107107
id: 'new-template-id',
108108
templateStatus: 'NOT_YET_SUBMITTED',
109109
name: 'template-name',
110-
letterType: 'q1',
110+
letterType: 'x1',
111111
language: 'ar',
112112
files: {
113113
pdfTemplate: {
@@ -137,7 +137,7 @@ describe('CreateLetterTemplate server actions', () => {
137137
{ ...initialState, id: 'existing-id' },
138138
getMockFormData({
139139
letterTemplateName: 'template-name',
140-
letterTemplateLetterType: 'q1',
140+
letterTemplateLetterType: 'x1',
141141
letterTemplateLanguage: 'ar',
142142
letterTemplatePdf,
143143
letterTemplateCsv,

frontend/src/__tests__/components/organisms/PreviewLetterTemplate.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('PreviewLetterTemplate component', () => {
1111
id: 'template-id',
1212
templateStatus: 'VIRUS_SCAN_FAILED',
1313
language: 'en',
14-
letterType: 'q1',
14+
letterType: 'x1',
1515
files: {
1616
pdfTemplate: {
1717
fileName: 'file.pdf',
@@ -90,7 +90,7 @@ describe('PreviewLetterTemplate component', () => {
9090
id: 'template-id',
9191
templateStatus: 'VALIDATION_FAILED',
9292
language: 'en',
93-
letterType: 'q1',
93+
letterType: 'x1',
9494
files: {
9595
pdfTemplate: {
9696
fileName: 'file.pdf',
@@ -121,7 +121,7 @@ describe('PreviewLetterTemplate component', () => {
121121
id: 'template-id',
122122
templateStatus: 'PENDING_UPLOAD',
123123
language: 'en',
124-
letterType: 'q1',
124+
letterType: 'x1',
125125
files: {
126126
pdfTemplate: {
127127
fileName: 'file.pdf',
@@ -147,7 +147,7 @@ describe('PreviewLetterTemplate component', () => {
147147
id: 'template-id',
148148
templateStatus: 'PENDING_VALIDATION',
149149
language: 'en',
150-
letterType: 'q1',
150+
letterType: 'x1',
151151
files: {
152152
pdfTemplate: {
153153
fileName: 'file.pdf',

frontend/src/__tests__/components/organisms/__snapshots__/PreviewLetterTemplate.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ exports[`PreviewLetterTemplate component matches snapshot when template status i
383383
<dd
384384
class="nhsuk-summary-list__value"
385385
>
386-
Braille letter
386+
Large print letter
387387
</dd>
388388
</div>
389389
<div
@@ -527,7 +527,7 @@ exports[`PreviewLetterTemplate component matches snapshot when template status i
527527
<dd
528528
class="nhsuk-summary-list__value"
529529
>
530-
Braille letter
530+
Large print letter
531531
</dd>
532532
</div>
533533
<div
@@ -705,7 +705,7 @@ exports[`PreviewLetterTemplate component matches snapshot when template status i
705705
<dd
706706
class="nhsuk-summary-list__value"
707707
>
708-
Braille letter
708+
Large print letter
709709
</dd>
710710
</div>
711711
<div
@@ -918,7 +918,7 @@ exports[`PreviewLetterTemplate component matches snapshot when template status i
918918
<dd
919919
class="nhsuk-summary-list__value"
920920
>
921-
Braille letter
921+
Large print letter
922922
</dd>
923923
</div>
924924
<div

frontend/src/__tests__/utils/form-actions.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('form-actions', () => {
108108
id: 'new-template-id',
109109
templateStatus: 'NOT_YET_SUBMITTED',
110110
name: 'template-name',
111-
letterType: 'q1',
111+
letterType: 'x1',
112112
language: 'ar',
113113
files: {
114114
pdfTemplate: {
@@ -166,7 +166,7 @@ describe('form-actions', () => {
166166
id: 'new-template-id',
167167
templateStatus: 'NOT_YET_SUBMITTED',
168168
name: 'template-name',
169-
letterType: 'q1',
169+
letterType: 'x1',
170170
language: 'ar',
171171
files: {
172172
pdfTemplate: {
@@ -592,7 +592,7 @@ describe('form-actions', () => {
592592
id: 'new-template-id',
593593
templateStatus: 'NOT_YET_SUBMITTED',
594594
name: 'template-name',
595-
letterType: 'q1',
595+
letterType: 'x1',
596596
language: 'ar',
597597
files: {
598598
pdfTemplate: {

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ module "backend_api" {
2020

2121
enable_backup = var.destination_vault_arn != null ? true : false
2222

23-
enable_letters = var.enable_letters
24-
enable_proofing = var.enable_proofing
25-
letter_suppliers = var.letter_suppliers
23+
enable_letters = var.enable_letters
24+
enable_proofing = var.enable_proofing
25+
letter_suppliers = var.letter_suppliers
26+
log_destination_arn = "arn:aws:logs:${var.region}:${var.observability_account_id}:destination:nhs-notify-main-acct-firehose-logs"
27+
log_subscription_role_arn = local.acct.log_subscription_role_arn
28+
2629
}

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ No requirements.
2222
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonmous with account short-name) | `string` | n/a | yes |
2323
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | KMS Key ARN | `string` | n/a | yes |
2424
| <a name="input_letter_suppliers"></a> [letter\_suppliers](#input\_letter\_suppliers) | Letter suppliers enabled in the environment | <pre>map(object({<br/> enable_polling = bool<br/> default_supplier = optional(bool)<br/> }))</pre> | n/a | yes |
25+
| <a name="input_log_destination_arn"></a> [log\_destination\_arn](#input\_log\_destination\_arn) | Destination ARN to use for the log subscription filter | `string` | `""` | no |
2526
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite | `number` | `0` | no |
27+
| <a name="input_log_subscription_role_arn"></a> [log\_subscription\_role\_arn](#input\_log\_subscription\_role\_arn) | The ARN of the IAM role to use for the log subscription filter | `string` | `""` | no |
2628
| <a name="input_module"></a> [module](#input\_module) | The variable encapsulating the name of this module | `string` | `"api"` | no |
2729
| <a name="input_parent_acct_environment"></a> [parent\_acct\_environment](#input\_parent\_acct\_environment) | Name of the environment responsible for the acct resources used | `string` | n/a | yes |
2830
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |

infrastructure/terraform/modules/backend-api/cloudwatch_log_group_api_gateway_access.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,12 @@ resource "aws_cloudwatch_log_group" "api_gateway_access" {
22
name = "/aws/api-gateway/${aws_api_gateway_rest_api.main.id}/${var.environment}/access-logs"
33
retention_in_days = var.log_retention_in_days
44
}
5+
6+
resource "aws_cloudwatch_log_subscription_filter" "api_gateway_access" {
7+
count = var.log_destination_arn != "" ? 1 : 0
8+
name = replace(aws_cloudwatch_log_group.api_gateway_access.name, "/", "-")
9+
log_group_name = aws_cloudwatch_log_group.api_gateway_access.name
10+
filter_pattern = ""
11+
destination_arn = var.log_destination_arn
12+
role_arn = var.log_subscription_role_arn
13+
}

infrastructure/terraform/modules/backend-api/cloudwatch_log_group_api_gateway_execution.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@ resource "aws_cloudwatch_log_group" "api_gateway_execution" {
55
)
66
retention_in_days = var.log_retention_in_days
77
}
8+
9+
resource "aws_cloudwatch_log_subscription_filter" "api_gateway_execution" {
10+
count = var.log_destination_arn != "" ? 1 : 0
11+
name = replace(aws_cloudwatch_log_group.api_gateway_execution.name, "/", "-")
12+
log_group_name = aws_cloudwatch_log_group.api_gateway_execution.name
13+
filter_pattern = ""
14+
destination_arn = var.log_destination_arn
15+
role_arn = var.log_subscription_role_arn
16+
}

0 commit comments

Comments
 (0)