Skip to content

Commit c996419

Browse files
Merge remote-tracking branch 'origin/main' into PRMP-1589
2 parents 3b851c5 + 2df70f4 commit c996419

7 files changed

Lines changed: 31 additions & 19 deletions

infrastructure/gateway-user-restrictions.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module "user_restrictions_gateway" {
77
gateway_path = "UserRestriction"
88
authorizer_id = aws_api_gateway_authorizer.repo_authoriser.id
99
require_credentials = true
10-
origin = contains(["prod"], terraform.workspace) ? "'https://${var.domain}'" : "'https://${terraform.workspace}.${var.domain}'"
10+
origin = local.base_url_with_quotes
1111
}
1212

1313
module "user_restriction_id_gateway" {
@@ -19,7 +19,7 @@ module "user_restriction_id_gateway" {
1919
authorization = "CUSTOM"
2020
authorizer_id = aws_api_gateway_authorizer.repo_authoriser.id
2121
require_credentials = true
22-
origin = contains(["prod"], terraform.workspace) ? "'https://${var.domain}'" : "'https://${terraform.workspace}.${var.domain}'"
22+
origin = local.base_url_with_quotes
2323

2424
request_parameters = {
2525
"method.request.path.id" = true
@@ -35,5 +35,5 @@ module "user_restrictions_user_search_gateway" {
3535
authorization = "CUSTOM"
3636
authorizer_id = aws_api_gateway_authorizer.repo_authoriser.id
3737
require_credentials = true
38-
origin = contains(["prod"], terraform.workspace) ? "'https://${var.domain}'" : "'https://${terraform.workspace}.${var.domain}'"
38+
origin = local.base_url_with_quotes
3939
}

infrastructure/lambda-create-user-restriction.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ module "create_user_restriction_lambda" {
55
iam_role_policy_documents = [
66
module.ndr-app-config.app_config_policy,
77
aws_iam_policy.ssm_access_policy.policy,
8-
module.user_restriction_table.dynamodb_write_policy_document
8+
module.user_restriction_table.dynamodb_write_policy_document,
9+
module.user_restriction_table.dynamodb_read_policy_document
910
]
1011
kms_deletion_window = var.kms_deletion_window
1112
rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id
1213
resource_id = module.user_restrictions_gateway.gateway_resource_id
1314
http_methods = ["POST"]
1415
api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn
1516
lambda_environment_variables = {
16-
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
17-
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
18-
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
19-
WORKSPACE = terraform.workspace
20-
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
17+
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
18+
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
19+
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
20+
WORKSPACE = terraform.workspace
21+
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
22+
HEALTHCARE_WORKER_API_URL = local.is_sandbox ? "" : data.aws_ssm_parameter.healthcare_worker_api_base_url.value
2123
}
2224

2325
depends_on = [
@@ -63,4 +65,4 @@ module "create_user_restriction_lambda_alarm_topic" {
6365
}
6466
]
6567
})
66-
}
68+
}

infrastructure/lambda-get-user-information.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ module "get_user_information_lambda" {
1212
http_methods = ["GET"]
1313
api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn
1414
lambda_environment_variables = {
15-
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
16-
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
17-
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
18-
WORKSPACE = terraform.workspace
15+
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
16+
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
17+
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
18+
WORKSPACE = terraform.workspace
19+
HEALTHCARE_WORKER_API_URL = data.aws_ssm_parameter.healthcare_worker_api_base_url.value
1920
}
2021

2122
depends_on = [

infrastructure/lambda-mns-notification.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module "mns-notification-lambda" {
1010
module.lloyd_george_reference_dynamodb_table.dynamodb_read_policy_document,
1111
module.document_upload_review_dynamodb_table.dynamodb_write_policy_document,
1212
module.document_upload_review_dynamodb_table.dynamodb_read_policy_document,
13+
module.user_restriction_table.dynamodb_read_policy_document,
14+
module.user_restriction_table.dynamodb_write_policy_document,
1315
aws_iam_policy.ssm_access_policy.policy,
1416
module.ndr-app-config.app_config_policy,
1517
aws_iam_policy.kms_mns_lambda_access[0].policy,
@@ -26,6 +28,7 @@ module "mns-notification-lambda" {
2628
DOCUMENT_REVIEW_DYNAMODB_NAME = module.document_upload_review_dynamodb_table.table_name
2729
MNS_NOTIFICATION_QUEUE_URL = module.sqs-mns-notification-queue[0].sqs_url
2830
PDS_FHIR_IS_STUBBED = local.is_sandbox
31+
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
2932
}
3033
is_gateway_integration_needed = false
3134
is_invoked_from_gateway = false

infrastructure/lambda-search-patient.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module "search-patient-details-lambda" {
6060
module.ndr-app-config.app_config_policy,
6161
module.auth_session_dynamodb_table.dynamodb_write_policy_document,
6262
module.auth_session_dynamodb_table.dynamodb_read_policy_document,
63+
module.user_restriction_table.dynamodb_read_policy_document,
6364
]
6465
kms_deletion_window = var.kms_deletion_window
6566
rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id
@@ -73,6 +74,7 @@ module "search-patient-details-lambda" {
7374
PDS_FHIR_IS_STUBBED = local.is_sandbox,
7475
WORKSPACE = terraform.workspace
7576
AUTH_SESSION_TABLE_NAME = "${terraform.workspace}_${var.auth_session_dynamodb_table_name}"
77+
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
7678
}
7779
api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn
7880
depends_on = [

infrastructure/lambda-search-user-restriction.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ module "search_user_restriction_lambda" {
1313
http_methods = ["GET"]
1414
api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn
1515
lambda_environment_variables = {
16-
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
17-
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
18-
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
19-
WORKSPACE = terraform.workspace
20-
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
16+
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
17+
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
18+
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
19+
WORKSPACE = terraform.workspace
20+
RESTRICTIONS_TABLE_NAME = module.user_restriction_table.table_name
21+
HEALTHCARE_WORKER_API_URL = data.aws_ssm_parameter.healthcare_worker_api_base_url.value
2122
}
2223

2324
depends_on = [

infrastructure/ssm_parameters_user_restrictions.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ module "healthcare_worker_api_base_url" {
1010
ignore_value_changes = true
1111
}
1212

13+
data "aws_ssm_parameter" "healthcare_worker_api_base_url" {
14+
name = "/ndr/${var.shared_infra_workspace}/hcw_api_url"
15+
}

0 commit comments

Comments
 (0)