@@ -31,19 +31,31 @@ resource "aws_dynamodb_table" "audit-table" {
3131
3232 global_secondary_index {
3333 name = " filename_index"
34- hash_key = " filename"
3534 projection_type = " ALL"
35+
36+ key_schema {
37+ attribute_name = " filename"
38+ key_type = " HASH"
39+ }
3640 }
3741
3842 global_secondary_index {
3943 name = " queue_name_index"
40- hash_key = " queue_name"
41- range_key = " status"
4244 projection_type = " ALL"
45+
46+ key_schema {
47+ attribute_name = " queue_name"
48+ key_type = " HASH"
49+ }
50+
51+ key_schema {
52+ attribute_name = " status"
53+ key_type = " RANGE"
54+ }
4355 }
4456
4557 point_in_time_recovery {
46- enabled = var. environment == " prod "
58+ enabled = var. dynamodb_point_in_time_recovery_enabled
4759 }
4860
4961 server_side_encryption {
@@ -95,26 +107,46 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" {
95107
96108 global_secondary_index {
97109 name = " SearchIndex"
98- hash_key = " Operation"
99- range_key = " DateTimeStamp"
100110 projection_type = " ALL"
111+
112+ key_schema {
113+ attribute_name = " Operation"
114+ key_type = " HASH"
115+ }
116+
117+ key_schema {
118+ attribute_name = " DateTimeStamp"
119+ key_type = " RANGE"
120+ }
101121 }
102122
103123 global_secondary_index {
104124 name = " SecondarySearchIndex"
105- hash_key = " SupplierSystem"
106- range_key = " VaccineType"
107125 projection_type = " ALL"
126+
127+ key_schema {
128+ attribute_name = " SupplierSystem"
129+ key_type = " HASH"
130+ }
131+
132+ key_schema {
133+ attribute_name = " VaccineType"
134+ key_type = " RANGE"
135+ }
108136 }
109137
110138 global_secondary_index {
111139 name = " ImmunisationIdIndex"
112- hash_key = " ImmsID"
113140 projection_type = " ALL"
141+
142+ key_schema {
143+ attribute_name = " ImmsID"
144+ key_type = " HASH"
145+ }
114146 }
115147
116148 point_in_time_recovery {
117- enabled = var. environment == " prod "
149+ enabled = var. dynamodb_point_in_time_recovery_enabled
118150 }
119151
120152 server_side_encryption {
@@ -154,19 +186,31 @@ resource "aws_dynamodb_table" "events-dynamodb-table" {
154186
155187 global_secondary_index {
156188 name = " PatientGSI"
157- hash_key = " PatientPK"
158- range_key = " PatientSK"
159189 projection_type = " ALL"
190+
191+ key_schema {
192+ attribute_name = " PatientPK"
193+ key_type = " HASH"
194+ }
195+
196+ key_schema {
197+ attribute_name = " PatientSK"
198+ key_type = " RANGE"
199+ }
160200 }
161201
162202 global_secondary_index {
163203 name = " IdentifierGSI"
164- hash_key = " IdentifierPK"
165204 projection_type = " ALL"
205+
206+ key_schema {
207+ attribute_name = " IdentifierPK"
208+ key_type = " HASH"
209+ }
166210 }
167211
168212 point_in_time_recovery {
169- enabled = var. environment == " prod "
213+ enabled = var. dynamodb_point_in_time_recovery_enabled
170214 }
171215
172216 server_side_encryption {
0 commit comments