Skip to content
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions infrastructure/dynamo_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,77 @@ module "bulk_upload_contact_lookup_table" {
},
]

environment = var.environment
owner = var.owner
}

module "user_restriction_table" {
source = "./modules/dynamo_db"
table_name = var.user_restrictions_table_name
hash_key = "ID"
deletion_protection_enabled = var.deletion_protection_enabled
point_in_time_recovery_enabled = !local.is_sandbox

attributes = [
{
name = "ID"
type = "S"
},
{
name = "RestrictedSmartCard"
type = "S"
},
{
name = "NhsNumber"
type = "S"
},
{
name = "Custodian"
type = "S"
},
{
name = "Created"
type = "N"
},
{
name = "CreatorSmartCard"
type = "S"
}
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need a RemoverSmartcardId

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as index?


global_secondary_indexes = [
{
name = "RestrictedSmartCardIndex"
hash_key = "RestrictedSmartCard"
range_key = "Created"
projection_type = "ALL"
},
{
name = "NhsNumberIndex"
hash_key = "NhsNumber"
range_key = "Created"
projection_type = "ALL"
},
{
name = "CustodianByNhsNumberIndex"
hash_key = "Custodian"
range_key = "NhsNumber"
projection_type = "ALL"
},
{
name = "CustodianBySmartCardIndex"
hash_key = "Custodian"
range_key = "RestrictedSmartCard"
projection_type = "ALL"
},
{
name = "CreatorIndex"
hash_key = "CreatorSmartCard"
range_key = "Created"
projection_type = "ALL"
}
]

environment = var.environment
owner = var.owner
}
6 changes: 6 additions & 0 deletions infrastructure/variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ variable "deletion_protection_enabled" {
default = false
}

variable "user_restrictions_table_name" {
description = "The DynamoDB table name for storing user restrictions"
type = string
default = "UserRestrictions"
}

# VPC Variables

variable "standalone_vpc_tag" {
Expand Down