Skip to content

Commit 14d8e8b

Browse files
committed
[PRM-823] Remove references to document store from Lambda configurations and IAM policies
Signed-off-by: NogaNHS <127490765+NogaNHS@users.noreply.github.com>
1 parent 77684c4 commit 14d8e8b

4 files changed

Lines changed: 0 additions & 42 deletions

File tree

infrastructure/ecs.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,6 @@ resource "aws_iam_role_policy_attachment" "data_collection_lloyd_george_store" {
142142
policy_arn = module.ndr-lloyd-george-store.s3_list_object_policy
143143
}
144144

145-
resource "aws_iam_role_policy_attachment" "data_collection_document_store" {
146-
count = local.is_sandbox ? 0 : 1
147-
role = aws_iam_role.data_collection_task_role[0].name
148-
policy_arn = module.ndr-document-store.s3_list_object_policy
149-
}
150-
151-
resource "aws_iam_role_policy_attachment" "data_collection_document_reference_dynamodb_table" {
152-
count = local.is_sandbox ? 0 : 1
153-
role = aws_iam_role.data_collection_task_role[0].name
154-
policy_arn = module.document_reference_dynamodb_table.dynamodb_policy
155-
}
156145

157146
resource "aws_iam_role_policy_attachment" "data_collection_cloudwatch_log_query_policy" {
158147
count = local.is_sandbox ? 0 : 1

infrastructure/lambda-delete-doc-object.tf

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ module "delete-document-object-lambda" {
4343
handler = "handlers.delete_document_object_handler.lambda_handler"
4444
lambda_timeout = 900
4545
iam_role_policy_documents = [
46-
module.document_reference_dynamodb_table.dynamodb_read_policy_document,
47-
module.document_reference_dynamodb_table.dynamodb_write_policy_document,
48-
module.ndr-document-store.s3_read_policy_document,
49-
module.ndr-document-store.s3_write_policy_document,
5046
module.lloyd_george_reference_dynamodb_table.dynamodb_read_policy_document,
5147
module.lloyd_george_reference_dynamodb_table.dynamodb_write_policy_document,
5248
module.ndr-lloyd-george-store.s3_read_policy_document,
@@ -78,7 +74,6 @@ resource "aws_iam_policy" "dynamodb_stream_delete_object_policy" {
7874
Effect = "Allow"
7975
Resource = [
8076
module.lloyd_george_reference_dynamodb_table.dynamodb_stream_arn,
81-
module.document_reference_dynamodb_table.dynamodb_stream_arn,
8277
module.unstitched_lloyd_george_reference_dynamodb_table.dynamodb_stream_arn
8378
]
8479
},
@@ -128,23 +123,3 @@ resource "aws_lambda_event_source_mapping" "unstitched_lloyd_george_dynamodb_str
128123
}
129124
}
130125

131-
resource "aws_lambda_event_source_mapping" "document_reference_dynamodb_stream" {
132-
event_source_arn = module.document_reference_dynamodb_table.dynamodb_stream_arn
133-
function_name = module.delete-document-object-lambda.lambda_arn
134-
batch_size = 1
135-
starting_position = "LATEST"
136-
137-
filter_criteria {
138-
filter {
139-
pattern = jsonencode({
140-
"eventName" : [
141-
"REMOVE"
142-
],
143-
userIdentity = {
144-
type = ["Service"],
145-
principalId = ["dynamodb.amazonaws.com"]
146-
}
147-
})
148-
}
149-
}
150-
}

infrastructure/lambda-generate-document-manifest.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ module "generate-document-manifest-lambda" {
4747
lambda_timeout = 900
4848
lambda_ephemeral_storage = 512
4949
iam_role_policy_documents = [
50-
module.ndr-document-store.s3_read_policy_document,
51-
module.ndr-document-store.s3_write_policy_document,
5250
module.ndr-lloyd-george-store.s3_read_policy_document,
5351
module.ndr-lloyd-george-store.s3_write_policy_document,
5452
module.zip_store_reference_dynamodb_table.dynamodb_read_policy_document,
@@ -77,7 +75,6 @@ module "generate-document-manifest-lambda" {
7775
module.ndr-app-config,
7876
module.zip_store_reference_dynamodb_table,
7977
module.ndr-zip-request-store,
80-
module.ndr-document-store,
8178
module.ndr-lloyd-george-store,
8279
aws_iam_policy.dynamodb_stream_manifest
8380
]

infrastructure/lambda-search-doc-references.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ module "search-document-references-lambda" {
5858
name = "SearchDocumentReferencesLambda"
5959
handler = "handlers.document_reference_search_handler.lambda_handler"
6060
iam_role_policy_documents = [
61-
module.document_reference_dynamodb_table.dynamodb_read_policy_document,
62-
module.document_reference_dynamodb_table.dynamodb_write_policy_document,
6361
module.lloyd_george_reference_dynamodb_table.dynamodb_read_policy_document,
6462
module.lloyd_george_reference_dynamodb_table.dynamodb_write_policy_document,
6563
module.ndr-lloyd-george-store.s3_read_policy_document,
66-
module.ndr-document-store.s3_read_policy_document,
6764
module.ndr-app-config.app_config_policy,
6865
aws_iam_policy.ssm_access_policy.policy
6966
]

0 commit comments

Comments
 (0)