Skip to content

Commit 9605585

Browse files
2 parents 040d9b2 + d31bf60 commit 9605585

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

.github/workflows/cron-daily-health-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888

8989
run_cypress_tests:
9090
name: Run Cypress Tests
91-
runs-on: ubuntu-22.04
91+
runs-on: ubuntu-latest
9292
steps:
9393
- name: Checkout
9494
uses: actions/checkout@v5

infrastructure/lambda-document-upload-check.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ resource "aws_s3_bucket_notification" "document_upload_check_lambda_trigger" {
6060
events = ["s3:ObjectCreated:*"]
6161
filter_prefix = "user_upload"
6262
}
63+
64+
lambda_function {
65+
lambda_function_arn = module.document_upload_check_lambda.lambda_arn
66+
events = ["s3:ObjectCreated:*"]
67+
filter_prefix = "fhir_upload"
68+
}
6369
}
6470

6571
resource "aws_lambda_permission" "document_upload_check_lambda" {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module "migration-dynamodb-lambda" {
2+
source = "./modules/lambda"
3+
name = "MigrationDynamoDB"
4+
handler = "handlers.migration_dynamodb_handler.lambda_handler"
5+
6+
iam_role_policy_documents = [
7+
module.lloyd_george_reference_dynamodb_table.dynamodb_read_policy_document,
8+
module.lloyd_george_reference_dynamodb_table.dynamodb_write_policy_document,
9+
module.bulk_upload_report_dynamodb_table.dynamodb_read_policy_document,
10+
module.ndr-bulk-staging-store.s3_read_policy_document,
11+
module.ndr-lloyd-george-store.s3_read_policy_document,
12+
aws_iam_policy.ssm_access_policy.policy,
13+
module.ndr-app-config.app_config_policy
14+
]
15+
16+
kms_deletion_window = var.kms_deletion_window
17+
rest_api_id = null
18+
api_execution_arn = null
19+
is_gateway_integration_needed = false
20+
is_invoked_from_gateway = false
21+
22+
lambda_environment_variables = {
23+
WORKSPACE = terraform.workspace
24+
APPCONFIG_APPLICATION = module.ndr-app-config.app_config_application_id
25+
APPCONFIG_ENVIRONMENT = module.ndr-app-config.app_config_environment_id
26+
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
27+
}
28+
29+
lambda_timeout = 900
30+
memory_size = 1024
31+
reserved_concurrent_executions = 200
32+
33+
depends_on = [
34+
module.lloyd_george_reference_dynamodb_table,
35+
module.bulk_upload_report_dynamodb_table,
36+
module.ndr-app-config,
37+
aws_iam_policy.ssm_access_policy,
38+
]
39+
}

infrastructure/policies.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,30 @@ resource "aws_iam_policy" "read_only_role_extra_permissions" {
4040
Workspace = "core"
4141
}
4242
}
43+
44+
resource "aws_iam_policy" "administrator_permission_restrictions" {
45+
count = local.is_sandbox ? 0 : 1
46+
name = "AdministratorRestriction"
47+
policy = jsonencode({
48+
Version = "2012-10-17",
49+
Statement = [
50+
{
51+
Effect = "Deny",
52+
Action = [
53+
"s3:DeleteObject",
54+
"s3:DeleteObjectVersion",
55+
"s3:PutLifecycleConfiguration",
56+
"s3:PutObject",
57+
"s3:RestoreObject"
58+
],
59+
Resource = [
60+
"arn:aws:s3:::*/*.tfstate"
61+
]
62+
}
63+
]
64+
})
65+
tags = {
66+
Name = "AdministratorRestriction"
67+
Workspace = "core"
68+
}
69+
}

0 commit comments

Comments
 (0)