Skip to content

Commit 6a86b1d

Browse files
CCM-10283: Template submitted email
1 parent 0ad5b9b commit 6a86b1d

Some content is hidden

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

49 files changed

+1229
-252
lines changed

frontend/package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
{
2-
"name": "nhs-notify-web-template-management-frontend",
3-
"version": "0.1.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "npm run mock-amplify-outputs && next lint --dir .",
10-
"lint:fix": "npm run lint -- --fix",
11-
"test:unit": "npm run mock-amplify-outputs && jest",
12-
"app:start": "pm2 start npm -- start",
13-
"app:wait": "wait-on -l http://localhost:3000/templates/create-and-submit-templates",
14-
"app:stop": "pm2 kill",
15-
"typecheck": "npm run mock-amplify-outputs && tsc --noEmit",
16-
"create-sandbox": "pm2 start npx -- ampx sandbox",
17-
"destroy-sandbox": "npx ampx sandbox delete --y",
18-
"mock-amplify-outputs": "if [ ! -f ./amplify_outputs.json ]; then echo \"{}\" > ./amplify_outputs.json ; fi"
19-
},
202
"dependencies": {
213
"@aws-amplify/adapter-nextjs": "^1.5.6",
224
"@aws-amplify/ui-react": "^6.9.4",
@@ -27,7 +9,6 @@
279
"jsonwebtoken": "^9.0.2",
2810
"jwt-decode": "^4.0.0",
2911
"markdown-it": "^13.0.2",
30-
"mimetext": "^3.0.27",
3112
"next": "^15.2.3",
3213
"next-client-cookies": "^2.0.1",
3314
"nhs-notify-backend-client": "^0.0.1",
@@ -67,5 +48,23 @@
6748
"typescript": "^5.8.2",
6849
"wait-on": "^8.0.3",
6950
"whatwg-fetch": "^3.6.20"
70-
}
51+
},
52+
"name": "nhs-notify-web-template-management-frontend",
53+
"private": true,
54+
"scripts": {
55+
"app:start": "pm2 start npm -- start",
56+
"app:stop": "pm2 kill",
57+
"app:wait": "wait-on -l http://localhost:3000/templates/create-and-submit-templates",
58+
"build": "next build",
59+
"create-sandbox": "pm2 start npx -- ampx sandbox",
60+
"destroy-sandbox": "npx ampx sandbox delete --y",
61+
"dev": "next dev",
62+
"lint": "npm run mock-amplify-outputs && next lint --dir .",
63+
"lint:fix": "npm run lint -- --fix",
64+
"mock-amplify-outputs": "if [ ! -f ./amplify_outputs.json ]; then echo \"{}\" > ./amplify_outputs.json ; fi",
65+
"start": "next start",
66+
"test:unit": "npm run mock-amplify-outputs && jest",
67+
"typecheck": "npm run mock-amplify-outputs && tsc --noEmit"
68+
},
69+
"version": "0.1.0"
7170
}

infrastructure/terraform/components/acct/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
| <a name="module_s3bucket_artefacts_us_east_1"></a> [s3bucket\_artefacts\_us\_east\_1](#module\_s3bucket\_artefacts\_us\_east\_1) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.2 |
4141
| <a name="module_s3bucket_backup_reports"></a> [s3bucket\_backup\_reports](#module\_s3bucket\_backup\_reports) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
4242
| <a name="module_s3bucket_data_migration_backups"></a> [s3bucket\_data\_migration\_backups](#module\_s3bucket\_data\_migration\_backups) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.4 |
43+
| <a name="module_sandbox_ses"></a> [sandbox\_ses](#module\_sandbox\_ses) | ../../modules/ses | n/a |
4344
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 5.19.0 |
4445
## Outputs
4546

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module "sandbox_ses" {
2+
source = "../../modules/ses"
3+
4+
count = var.support_sandbox_environments ? 1 : 0
5+
6+
aws_account_id = var.aws_account_id
7+
region = var.region
8+
project = var.project
9+
environment = var.environment
10+
component = var.component
11+
12+
kms_key_arn = module.kms_sandbox.0.key_arn
13+
14+
root_domain_name = "sandbox.${aws_route53_zone.main.name}"
15+
16+
zone_id = aws_route53_zone.main.id
17+
18+
use_sftp_letter_supplier_mock = local.use_sftp_letter_supplier_mock
19+
}

infrastructure/terraform/components/app/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
| <a name="input_external_email_domain"></a> [external\_email\_domain](#input\_external\_email\_domain) | Externally managed domain used to create an SES identity for sending emails from. Validation DNS records will need to be manually configured in the DNS provider. | `string` | `null` | no |
3838
| <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 |
3939
| <a name="input_kms_deletion_window"></a> [kms\_deletion\_window](#input\_kms\_deletion\_window) | When a kms key is deleted, how long should it wait in the pending deletion state? | `string` | `"30"` | no |
40-
| <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> | `{}` | no |
40+
| <a name="input_letter_suppliers"></a> [letter\_suppliers](#input\_letter\_suppliers) | Letter suppliers enabled in the environment | <pre>map(object({<br/> email_addresses = list(string)<br/> enable_polling = bool<br/> default_supplier = optional(bool)<br/> }))</pre> | `{}` | no |
4141
| <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 |
4242
| <a name="input_observability_account_id"></a> [observability\_account\_id](#input\_observability\_account\_id) | The Observability Account ID that needs access | `string` | n/a | yes |
4343
| <a name="input_parent_acct_environment"></a> [parent\_acct\_environment](#input\_parent\_acct\_environment) | Name of the environment responsible for the acct resources used, affects things like DNS zone. Useful for named dev environments | `string` | `"main"` | no |
@@ -57,6 +57,7 @@
5757
| <a name="module_kms_us_east_1"></a> [kms\_us\_east\_1](#module\_kms\_us\_east\_1) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v1.0.8 |
5858
| <a name="module_nhse_backup_vault"></a> [nhse\_backup\_vault](#module\_nhse\_backup\_vault) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source | v2.0.12 |
5959
| <a name="module_s3bucket_cf_logs"></a> [s3bucket\_cf\_logs](#module\_s3bucket\_cf\_logs) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.2 |
60+
| <a name="module_ses"></a> [ses](#module\_ses) | ../../modules/ses | n/a |
6061
## Outputs
6162

6263
| Name | Description |

infrastructure/terraform/components/app/locals.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ locals {
22
cloudfront_files_domain_name = "files.${local.root_domain_name}"
33
root_domain_name = "${var.environment}.${local.acct.dns_zone["name"]}"
44
lambdas_source_code_dir = "../../../../lambdas"
5+
6+
mock_letter_supplier_name = "WTMMOCK"
7+
8+
use_sftp_letter_supplier_mock = lookup(var.letter_suppliers, local.mock_letter_supplier_name, null) != null
59
}

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ module "backend_api" {
2727
log_subscription_role_arn = local.acct.log_subscription_role_arn
2828

2929
send_to_firehose = true
30+
31+
email_domain = local.root_domain_name
32+
ses_domain_identity_arns = module.ses.domain_identity_arns
33+
34+
mock_letter_supplier_name = local.mock_letter_supplier_name
35+
use_sftp_letter_supplier_mock = lookup(var.letter_suppliers, local.mock_letter_supplier_name, null) != null
3036
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module "ses" {
2+
source = "../../modules/ses"
3+
4+
aws_account_id = var.aws_account_id
5+
region = var.region
6+
project = var.project
7+
environment = var.environment
8+
component = var.component
9+
10+
kms_key_arn = module.kms.key_arn
11+
12+
root_domain_name = local.root_domain_name
13+
14+
external_email_domain = var.external_email_domain
15+
zone_id = local.acct.dns_zone["id"]
16+
17+
use_sftp_letter_supplier_mock = local.use_sftp_letter_supplier_mock
18+
}

infrastructure/terraform/components/app/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ variable "observability_account_id" {
195195

196196
variable "letter_suppliers" {
197197
type = map(object({
198+
email_addresses = list(string)
198199
enable_polling = bool
199200
default_supplier = optional(bool)
200201
}))

infrastructure/terraform/components/sandbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ No requirements.
1515
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
1616
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonymous with account short-name) | `string` | n/a | yes |
1717
| <a name="input_kms_deletion_window"></a> [kms\_deletion\_window](#input\_kms\_deletion\_window) | When a kms key is deleted, how long should it wait in the pending deletion state? | `string` | `"30"` | no |
18-
| <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> | <pre>{<br/> "WTMMOCK": {<br/> "default_supplier": true,<br/> "enable_polling": true<br/> }<br/>}</pre> | no |
18+
| <a name="input_letter_suppliers"></a> [letter\_suppliers](#input\_letter\_suppliers) | Letter suppliers enabled in the environment | <pre>map(object({<br/> email_addresses = list(string)<br/> enable_polling = bool<br/> default_supplier = optional(bool)<br/> }))</pre> | <pre>{<br/> "WTMMOCK": {<br/> "default_supplier": true,<br/> "email_addresses": [<br/> "[email protected]"<br/> ],<br/> "enable_polling": true<br/> }<br/>}</pre> | no |
1919
| <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 |
2020
| <a name="input_parent_acct_environment"></a> [parent\_acct\_environment](#input\_parent\_acct\_environment) | Name of the environment responsible for the acct resources used, affects things like DNS zone. Useful for named dev environments | `string` | `"main"` | no |
2121
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
locals {
2+
mock_letter_supplier_name = "WTMMOCK"
3+
4+
use_sftp_letter_supplier_mock = lookup(var.letter_suppliers, local.mock_letter_supplier_name, null) != null
5+
}

0 commit comments

Comments
 (0)