Skip to content

Commit f289868

Browse files
authored
CCM-8637: sftp send proof (#398)
1 parent 48d81c7 commit f289868

File tree

109 files changed

+6142
-119
lines changed

Some content is hidden

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

109 files changed

+6142
-119
lines changed

frontend/jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const config: Config = {
2222
...baseJestConfig,
2323

2424
coveragePathIgnorePatterns: [
25+
...(baseJestConfig.coveragePathIgnorePatterns ?? []),
2526
'.types.ts',
2627
'layout.tsx',
2728
'container.tsx',

infrastructure/terraform/components/acct/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
| <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 |
2020
| <a name="input_initial_cli_secrets_provision_override"></a> [initial\_cli\_secrets\_provision\_override](#input\_initial\_cli\_secrets\_provision\_override) | A map of default value to intialise SSM secret values with. Only useful for initial setup of the account due to lifecycle rules. | `map(string)` | `{}` | no |
2121
| <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 |
22+
| <a name="input_letter_suppliers"></a> [letter\_suppliers](#input\_letter\_suppliers) | Letter suppliers enabled in the account (across all environments) | <pre>map(object({<br/> enable_polling = bool<br/> default_supplier = optional(bool)<br/> }))</pre> | `{}` | no |
2223
| <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 |
2324
| <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 |
2425
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |

infrastructure/terraform/components/acct/locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ locals {
1414
for az_index, az in data.aws_availability_zones.available.names :
1515
cidrsubnet(var.vpc_cidr, max(var.vpc_subnet_cidr_bits.private, local.required_bits_private), az_index + length(data.aws_availability_zones.available.names))
1616
]
17+
18+
mock_letter_supplier_name = "WTMMOCK"
19+
use_sftp_letter_supplier_mock = lookup(var.letter_suppliers, local.mock_letter_supplier_name, null) != null
1720
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
resource "aws_ssm_parameter" "sftp_mock_config" {
2+
count = local.use_sftp_letter_supplier_mock ? 1 : 0
3+
4+
name = format(
5+
"/%s/sftp-mock-config",
6+
local.csi,
7+
)
8+
description = "Configuration values for accessing an SFTP mock server"
9+
type = "SecureString"
10+
11+
/*
12+
JSON object matching:
13+
{
14+
"host": string
15+
"username": string,
16+
"privateKey": string,
17+
"baseUploadDir": "WTMMOCK/Incoming,
18+
"baseDownloadDir": "WTMMOCK/Outgoing"
19+
}
20+
*/
21+
value = "placeholder"
22+
23+
lifecycle {
24+
ignore_changes = [value]
25+
}
26+
}

infrastructure/terraform/components/acct/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,13 @@ variable "vpc_subnet_cidr_bits" {
104104
private = 3 # Larger subnets for private resources, 3 creates /19 subnets over 3x Az
105105
}
106106
}
107+
108+
variable "letter_suppliers" {
109+
type = map(object({
110+
enable_polling = bool
111+
default_supplier = optional(bool)
112+
}))
113+
description = "Letter suppliers enabled in the account (across all environments)"
114+
115+
default = {}
116+
}

infrastructure/terraform/components/app/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
| <a name="input_event_delivery_logging_success_sample_percentage"></a> [event\_delivery\_logging\_success\_sample\_percentage](#input\_event\_delivery\_logging\_success\_sample\_percentage) | Enable caching of events to an S3 bucket | `number` | `0` | no |
3737
| <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 |
3838
| <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 |
39+
| <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 |
3940
| <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 |
4041
| <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 |
4142
| <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 |

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
module "backend_api" {
44
source = "../../modules/backend-api"
55

6-
project = var.project
7-
environment = var.environment
8-
component = var.component
9-
aws_account_id = var.aws_account_id
10-
region = var.region
11-
group = var.group
12-
csi = local.csi
13-
log_retention_in_days = var.log_retention_in_days
14-
kms_key_arn = module.kms.key_arn
6+
project = var.project
7+
environment = var.environment
8+
component = var.component
9+
aws_account_id = var.aws_account_id
10+
region = var.region
11+
group = var.group
12+
csi = local.csi
13+
log_retention_in_days = var.log_retention_in_days
14+
kms_key_arn = module.kms.key_arn
15+
parent_acct_environment = var.parent_acct_environment
1516

1617
cognito_config = jsondecode(aws_ssm_parameter.cognito_config.value)
1718

1819
enable_backup = var.destination_vault_arn != null ? true : false
1920

20-
enable_letters = var.enable_letters
21+
enable_letters = var.enable_letters
22+
letter_suppliers = var.letter_suppliers
2123
}

infrastructure/terraform/components/app/variables.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,22 @@ variable "observability_account_id" {
192192
type = string
193193
description = "The Observability Account ID that needs access"
194194
}
195+
196+
variable "letter_suppliers" {
197+
type = map(object({
198+
enable_polling = bool
199+
default_supplier = optional(bool)
200+
}))
201+
202+
validation {
203+
condition = (
204+
length(var.letter_suppliers) == 0 ||
205+
length([for s in values(var.letter_suppliers) : s if s.default_supplier]) == 1
206+
)
207+
error_message = "If letter suppliers are configured, exactly one must be default_supplier"
208+
}
209+
210+
default = {}
211+
212+
description = "Letter suppliers enabled in the environment"
213+
}

infrastructure/terraform/components/sandbox/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +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 |
1819
| <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 |
1920
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
2021
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
@@ -32,6 +33,9 @@ No requirements.
3233
| <a name="output_cognito_user_pool_id"></a> [cognito\_user\_pool\_id](#output\_cognito\_user\_pool\_id) | n/a |
3334
| <a name="output_internal_bucket_name"></a> [internal\_bucket\_name](#output\_internal\_bucket\_name) | n/a |
3435
| <a name="output_quarantine_bucket_name"></a> [quarantine\_bucket\_name](#output\_quarantine\_bucket\_name) | n/a |
36+
| <a name="output_send_proof_queue_url"></a> [send\_proof\_queue\_url](#output\_send\_proof\_queue\_url) | n/a |
37+
| <a name="output_sftp_environment"></a> [sftp\_environment](#output\_sftp\_environment) | n/a |
38+
| <a name="output_sftp_mock_credential_path"></a> [sftp\_mock\_credential\_path](#output\_sftp\_mock\_credential\_path) | n/a |
3539
| <a name="output_templates_table_name"></a> [templates\_table\_name](#output\_templates\_table\_name) | n/a |
3640
<!-- vale on -->
3741
<!-- markdownlint-enable -->

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
module "backend_api" {
22
source = "../../modules/backend-api"
33

4-
project = var.project
5-
environment = var.environment
6-
component = var.component
7-
aws_account_id = var.aws_account_id
8-
region = var.region
9-
group = var.group
10-
csi = local.csi
11-
log_retention_in_days = var.log_retention_in_days
4+
project = var.project
5+
environment = var.environment
6+
component = var.component
7+
aws_account_id = var.aws_account_id
8+
region = var.region
9+
group = var.group
10+
csi = local.csi
11+
log_retention_in_days = var.log_retention_in_days
12+
parent_acct_environment = "main"
1213

1314

1415
cognito_config = {
1516
USER_POOL_ID = aws_cognito_user_pool.sandbox.id
1617
USER_POOL_CLIENT_ID = aws_cognito_user_pool_client.sandbox.id
1718
}
1819

19-
enable_letters = true
20+
enable_letters = true
21+
letter_suppliers = var.letter_suppliers
2022

2123
kms_key_arn = data.aws_kms_key.sandbox.arn
2224
dynamodb_kms_key_arn = data.aws_kms_key.sandbox.arn

0 commit comments

Comments
 (0)