Skip to content

Commit 43d8bd2

Browse files
authored
Merge branch 'main' into feature/CCM-13475-pdf-analysis
2 parents fdeb467 + 571608e commit 43d8bd2

File tree

78 files changed

+4081
-58
lines changed

Some content is hidden

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

78 files changed

+4081
-58
lines changed

infrastructure/terraform/components/dl/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ No requirements.
1111
|------|-------------|------|---------|:--------:|
1212
| <a name="input_apim_auth_token_schedule"></a> [apim\_auth\_token\_schedule](#input\_apim\_auth\_token\_schedule) | Schedule to renew the APIM auth token | `string` | `"rate(9 minutes)"` | no |
1313
| <a name="input_apim_auth_token_url"></a> [apim\_auth\_token\_url](#input\_apim\_auth\_token\_url) | URL to generate an APIM auth token | `string` | `"https://int.api.service.nhs.uk/oauth2/token"` | no |
14-
| <a name="input_apim_base_url"></a> [apim\_base\_url](#input\_apim\_base\_url) | The URL used to send requests to Notify and PDM | `string` | `"https://sandbox.api.service.nhs.uk"` | no |
14+
| <a name="input_apim_base_url"></a> [apim\_base\_url](#input\_apim\_base\_url) | The URL used to send requests to Notify and PDM | `string` | `"https://int.api.service.nhs.uk"` | no |
1515
| <a name="input_apim_keygen_schedule"></a> [apim\_keygen\_schedule](#input\_apim\_keygen\_schedule) | Schedule to refresh key pairs if necessary | `string` | `"cron(0 14 * * ? *)"` | no |
1616
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
1717
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"dl"` | 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_enable_dynamodb_delete_protection"></a> [enable\_dynamodb\_delete\_protection](#input\_enable\_dynamodb\_delete\_protection) | Enable DynamoDB Delete Protection on all Tables | `bool` | `true` | no |
20+
| <a name="input_enable_pdm_mock"></a> [enable\_pdm\_mock](#input\_enable\_pdm\_mock) | Flag indicating whether to deploy PDM mock API (should be false in production environments) | `bool` | `true` | no |
2021
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
2122
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | Flag to force deletion of S3 buckets | `bool` | `false` | no |
2223
| <a name="input_force_lambda_code_deploy"></a> [force\_lambda\_code\_deploy](#input\_force\_lambda\_code\_deploy) | If the lambda package in s3 has the same commit id tag as the terraform build branch, the lambda will not update automatically. Set to True if making changes to Lambda code from on the same commit for example during development | `bool` | `false` | no |
@@ -26,6 +27,8 @@ No requirements.
2627
| <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 |
2728
| <a name="input_mesh_poll_schedule"></a> [mesh\_poll\_schedule](#input\_mesh\_poll\_schedule) | Schedule to poll MESH for messages | `string` | `"cron(0,30 8-16 ? * MON-FRI *)"` | no |
2829
| <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 |
30+
| <a name="input_pdm_mock_access_token"></a> [pdm\_mock\_access\_token](#input\_pdm\_mock\_access\_token) | Mock access token for PDM API authentication (used in local/dev environments) | `string` | `"mock-pdm-token"` | no |
31+
| <a name="input_pdm_use_non_mock_token"></a> [pdm\_use\_non\_mock\_token](#input\_pdm\_use\_non\_mock\_token) | Whether to use the shared APIM access token from SSM (/component/environment/apim/access\_token) instead of the mock token | `bool` | `false` | no |
2932
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
3033
| <a name="input_queue_batch_size"></a> [queue\_batch\_size](#input\_queue\_batch\_size) | maximum number of queue items to process | `number` | `10` | no |
3134
| <a name="input_queue_batch_window_seconds"></a> [queue\_batch\_window\_seconds](#input\_queue\_batch\_window\_seconds) | maximum time in seconds between processing events | `number` | `10` | no |
@@ -40,10 +43,13 @@ No requirements.
4043
| <a name="module_lambda_apim_key_generation"></a> [lambda\_apim\_key\_generation](#module\_lambda\_apim\_key\_generation) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4144
| <a name="module_lambda_lambda_apim_refresh_token"></a> [lambda\_lambda\_apim\_refresh\_token](#module\_lambda\_lambda\_apim\_refresh\_token) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4245
| <a name="module_mesh_poll"></a> [mesh\_poll](#module\_mesh\_poll) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
46+
| <a name="module_pdm_mock"></a> [pdm\_mock](#module\_pdm\_mock) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
47+
| <a name="module_pdm_uploader"></a> [pdm\_uploader](#module\_pdm\_uploader) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4348
| <a name="module_s3bucket_cf_logs"></a> [s3bucket\_cf\_logs](#module\_s3bucket\_cf\_logs) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4449
| <a name="module_s3bucket_letters"></a> [s3bucket\_letters](#module\_s3bucket\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4550
| <a name="module_s3bucket_static_assets"></a> [s3bucket\_static\_assets](#module\_s3bucket\_static\_assets) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4651
| <a name="module_sqs_event_publisher_errors"></a> [sqs\_event\_publisher\_errors](#module\_sqs\_event\_publisher\_errors) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
52+
| <a name="module_sqs_pdm_uploader"></a> [sqs\_pdm\_uploader](#module\_sqs\_pdm\_uploader) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4753
| <a name="module_sqs_ttl"></a> [sqs\_ttl](#module\_sqs\_ttl) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4854
| <a name="module_sqs_ttl_handle_expiry_errors"></a> [sqs\_ttl\_handle\_expiry\_errors](#module\_sqs\_ttl\_handle\_expiry\_errors) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4955
| <a name="module_ttl_create"></a> [ttl\_create](#module\_ttl\_create) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
resource "aws_api_gateway_deployment" "pdm_mock" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
depends_on = [
5+
aws_api_gateway_integration.create_document_reference,
6+
aws_api_gateway_integration.get_document_reference,
7+
]
8+
9+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
10+
11+
triggers = {
12+
redeployment = sha1(jsonencode([
13+
aws_api_gateway_resource.patient_data_manager[0].id,
14+
aws_api_gateway_resource.fhir[0].id,
15+
aws_api_gateway_resource.r4[0].id,
16+
aws_api_gateway_resource.document_reference[0].id,
17+
aws_api_gateway_resource.document_reference_id[0].id,
18+
aws_api_gateway_method.create_document_reference[0].id,
19+
aws_api_gateway_method.get_document_reference[0].id,
20+
aws_api_gateway_integration.create_document_reference[0].id,
21+
aws_api_gateway_integration.get_document_reference[0].id,
22+
]))
23+
}
24+
25+
lifecycle {
26+
create_before_destroy = true
27+
}
28+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "aws_api_gateway_integration" "create_document_reference" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
resource_id = aws_api_gateway_resource.document_reference[0].id
6+
http_method = aws_api_gateway_method.create_document_reference[0].http_method
7+
8+
integration_http_method = "POST"
9+
type = "AWS_PROXY"
10+
uri = module.pdm_mock[0].function_invoke_arn
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "aws_api_gateway_integration" "get_document_reference" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
resource_id = aws_api_gateway_resource.document_reference_id[0].id
6+
http_method = aws_api_gateway_method.get_document_reference[0].http_method
7+
8+
integration_http_method = "POST"
9+
type = "AWS_PROXY"
10+
uri = module.pdm_mock[0].function_invoke_arn
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_api_gateway_method" "create_document_reference" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
resource_id = aws_api_gateway_resource.document_reference[0].id
6+
http_method = "POST"
7+
authorization = "AWS_IAM"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_api_gateway_method" "get_document_reference" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
resource_id = aws_api_gateway_resource.document_reference_id[0].id
6+
http_method = "GET"
7+
authorization = "AWS_IAM"
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_api_gateway_resource" "document_reference" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
parent_id = aws_api_gateway_resource.r4[0].id
6+
path_part = "DocumentReference"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_api_gateway_resource" "document_reference_id" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
parent_id = aws_api_gateway_resource.document_reference[0].id
6+
path_part = "{id}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_api_gateway_resource" "fhir" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
parent_id = aws_api_gateway_resource.patient_data_manager[0].id
6+
path_part = "FHIR"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_api_gateway_resource" "patient_data_manager" {
2+
count = local.deploy_pdm_mock ? 1 : 0
3+
4+
rest_api_id = aws_api_gateway_rest_api.pdm_mock[0].id
5+
parent_id = aws_api_gateway_rest_api.pdm_mock[0].root_resource_id
6+
path_part = "patient-data-manager"
7+
}

0 commit comments

Comments
 (0)