File tree Expand file tree Collapse file tree 4 files changed +79
-0
lines changed
Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,61 @@ module "statistics_dynamodb_table" {
345345 }
346346 ]
347347
348+ environment = var. environment
349+ owner = var. owner
350+ }
351+
352+ module "access_audit_dynamodb_table" {
353+ source = " ./modules/dynamo_db"
354+ table_name = var. access_audit_dynamodb_table_name
355+ hash_key = " Type"
356+ sort_key = " ID"
357+ deletion_protection_enabled = local. is_production
358+ stream_enabled = false
359+ ttl_enabled = false
360+ point_in_time_recovery_enabled = ! local. is_sandbox
361+
362+ attributes = [
363+ {
364+ name = " Type"
365+ type = " S"
366+ },
367+ {
368+ name = " ID"
369+ type = " S"
370+ },
371+ {
372+ name = " UserSessionID"
373+ type = " S"
374+ },
375+ {
376+ name = " UserID"
377+ type = " S"
378+ },
379+ {
380+ name = " UserOdsCode"
381+ type = " S"
382+ }
383+ ]
384+
385+ global_secondary_indexes = [
386+ {
387+ name = " UserSessionIDIndex"
388+ hash_key = " UserSessionID"
389+ projection_type = " ALL"
390+ },
391+ {
392+ name = " UserIDIndex"
393+ hash_key = " UserID"
394+ projection_type = " ALL"
395+ },
396+ {
397+ name = " UserOdsCodeIndex"
398+ hash_key = " UserOdsCode"
399+ projection_type = " ALL"
400+ }
401+ ]
402+
348403 environment = var. environment
349404 owner = var. owner
350405}
Original file line number Diff line number Diff line change @@ -120,4 +120,18 @@ data "aws_iam_policy_document" "dynamodb_write_policy" {
120120 aws_dynamodb_table . ndr_dynamodb_table . arn ,
121121 ]
122122 }
123+ }
124+
125+ data "aws_iam_policy_document" "dynamodb_write_without_update_policy" {
126+ statement {
127+ effect = " Allow"
128+ actions = [
129+ " dynamodb:PutItem" ,
130+ " dynamodb:DeleteItem" ,
131+ " dynamodb:BatchWriteItem"
132+ ]
133+ resources = [
134+ aws_dynamodb_table . ndr_dynamodb_table . arn ,
135+ ]
136+ }
123137}
Original file line number Diff line number Diff line change @@ -20,4 +20,8 @@ output "dynamodb_read_policy_document" {
2020
2121output "dynamodb_write_policy_document" {
2222 value = data. aws_iam_policy_document . dynamodb_write_policy . json
23+ }
24+
25+ output "dynamodb_write_without_update_policy_document" {
26+ value = data. aws_iam_policy_document . dynamodb_write_without_update_policy . json
2327}
Original file line number Diff line number Diff line change @@ -106,6 +106,12 @@ variable "statistics_dynamodb_table_name" {
106106 default = " ApplicationStatistics"
107107}
108108
109+ variable "access_audit_dynamodb_table_name" {
110+ type = string
111+ description = " The name of the dynamodb table to store the audit of access to deceased patient records"
112+ default = " AccessAudit"
113+ }
114+
109115# VPC Variables
110116
111117variable "standalone_vpc_tag" {
You can’t perform that action at this time.
0 commit comments