@@ -51,143 +51,32 @@ module "sqs_queues" {
5151 resource_prefix = var. ProjectId
5252}
5353
54- import {
55- to = aws_dynamodb_table . app_audit_log
56- id = " ${ var . ProjectId } -audit-log "
54+ module "dynamo" {
55+ source = " ../../modules/dynamo "
56+ ProjectId = var. ProjectId
5757}
58-
59- resource "aws_dynamodb_table" "app_audit_log" {
60- billing_mode = " PAY_PER_REQUEST"
61- name = " ${ var . ProjectId } -audit-log"
62- deletion_protection_enabled = true
63- hash_key = " module"
64- range_key = " createdAt"
65- point_in_time_recovery {
66- enabled = true
67- }
68- attribute {
69- name = " module"
70- type = " S"
71- }
72- attribute {
73- name = " createdAt"
74- type = " N"
75- }
76- ttl {
77- attribute_name = " expiresAt"
78- enabled = true
79- }
58+ moved {
59+ from = aws_dynamodb_table. app_audit_log
60+ to = module. dynamo . aws_dynamodb_table . app_audit_log
8061}
8162
82- module "lambda_warmer" {
83- source = " github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=v0.1.1 "
84- function_to_warm = " infra-core-api-lambda "
63+ moved {
64+ from = aws_dynamodb_table . membership_provisioning_log
65+ to = module . dynamo . aws_dynamodb_table . membership_provisioning_log
8566}
8667
87- // Membership Logs
88- import {
89- to = aws_dynamodb_table. membership_provisioning_log
90- id = " ${ var . ProjectId } -membership-provisioning"
91- }
92- resource "aws_dynamodb_table" "membership_provisioning_log" {
93- billing_mode = " PAY_PER_REQUEST"
94- name = " ${ var . ProjectId } -membership-provisioning"
95- deletion_protection_enabled = true
96- hash_key = " email"
97- point_in_time_recovery {
98- enabled = true
99- }
100- attribute {
101- name = " email"
102- type = " S"
103- }
104- }
10568
106- // API Keys
107- import {
108- to = aws_dynamodb_table. api_keys
109- id = " ${ var . ProjectId } -keys"
110- }
111- resource "aws_dynamodb_table" "api_keys" {
112- billing_mode = " PAY_PER_REQUEST"
113- name = " ${ var . ProjectId } -keys"
114- deletion_protection_enabled = true
115- hash_key = " keyId"
116- point_in_time_recovery {
117- enabled = true
118- }
119- attribute {
120- name = " keyId"
121- type = " S"
122- }
123- ttl {
124- attribute_name = " expiresAt"
125- enabled = true
126- }
69+ moved {
70+ from = aws_dynamodb_table. api_keys
71+ to = module. dynamo . aws_dynamodb_table . api_keys
12772}
12873
129- // Room Requests
130- import {
131- to = aws_dynamodb_table. room_requests
132- id = " ${ var . ProjectId } -room-requests"
133- }
134- import {
135- to = aws_dynamodb_table. room_requests_status
136- id = " ${ var . ProjectId } -room-requests-status"
137- }
138- resource "aws_dynamodb_table" "room_requests" {
139- billing_mode = " PAY_PER_REQUEST"
140- name = " ${ var . ProjectId } -room-requests"
141- deletion_protection_enabled = true
142- hash_key = " semesterId"
143- range_key = " userId#requestId"
144- point_in_time_recovery {
145- enabled = true
146- }
147- attribute {
148- name = " userId#requestId"
149- type = " S"
150- }
151- attribute {
152- name = " requestId"
153- type = " S"
154- }
155- attribute {
156- name = " semesterId"
157- type = " S"
158- }
159- global_secondary_index {
160- name = " RequestIdIndex"
161- hash_key = " requestId"
162- projection_type = " ALL"
163- }
74+ moved {
75+ from = aws_dynamodb_table. room_requests
76+ to = module. dynamo . aws_dynamodb_table . room_requests
16477}
16578
166- resource "aws_dynamodb_table" "room_requests_status" {
167- billing_mode = " PAY_PER_REQUEST"
168- name = " ${ var . ProjectId } -room-requests-status"
169- deletion_protection_enabled = true
170- hash_key = " requestId"
171- range_key = " createdAt#status"
172- point_in_time_recovery {
173- enabled = true
174- }
175- attribute {
176- name = " createdAt#status"
177- type = " S"
178- }
179- attribute {
180- name = " requestId"
181- type = " S"
182- }
183- attribute {
184- name = " semesterId"
185- type = " S"
186- }
187- global_secondary_index {
188- name = " SemesterId"
189- hash_key = " semesterId"
190- range_key = " requestId"
191- projection_type = " ALL"
192- }
79+ moved {
80+ from = aws_dynamodb_table. room_requests_status
81+ to = module. dynamo . aws_dynamodb_table . room_requests_status
19382}
0 commit comments