File tree Expand file tree Collapse file tree 3 files changed +81
-40
lines changed Expand file tree Collapse file tree 3 files changed +81
-40
lines changed Original file line number Diff line number Diff line change @@ -305,43 +305,6 @@ Resources:
305305 FunctionResponseTypes :
306306 - ReportBatchItemFailures
307307
308- MembershipRecordsTable :
309- Type : " AWS::DynamoDB::Table"
310- DeletionPolicy : " Retain"
311- UpdateReplacePolicy : " Retain"
312- Properties :
313- BillingMode : " PAY_PER_REQUEST"
314- TableName : infra-core-api-membership-provisioning
315- DeletionProtectionEnabled : true
316- PointInTimeRecoverySpecification :
317- PointInTimeRecoveryEnabled : !If [IsProd, true, false]
318- AttributeDefinitions :
319- - AttributeName : email
320- AttributeType : S
321- KeySchema :
322- - AttributeName : email
323- KeyType : HASH
324-
325- ApiKeyTable :
326- Type : " AWS::DynamoDB::Table"
327- DeletionPolicy : " Retain"
328- UpdateReplacePolicy : " Retain"
329- Properties :
330- BillingMode : " PAY_PER_REQUEST"
331- TableName : infra-core-api-keys
332- DeletionProtectionEnabled : !If [IsProd, true, false]
333- PointInTimeRecoverySpecification :
334- PointInTimeRecoveryEnabled : !If [IsProd, true, false]
335- AttributeDefinitions :
336- - AttributeName : keyId
337- AttributeType : S
338- KeySchema :
339- - AttributeName : keyId
340- KeyType : HASH
341- TimeToLiveSpecification :
342- AttributeName : expiresAt
343- Enabled : true
344-
345308 ExternalMembershipV3RecordsTable :
346309 Type : " AWS::DynamoDB::Table"
347310 DeletionPolicy : " Retain"
Original file line number Diff line number Diff line change @@ -82,10 +82,45 @@ module "lambda_warmer" {
8282 source = " github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=v0.1.1"
8383 function_to_warm = " infra-core-api-lambda"
8484}
85- resource "null_resource" "delete_legacy_table" {
8685
87- provisioner "local-exec" {
88- command = " aws dynamodb update-table --table-name infra-core-api-membership-external --no-deletion-protection-enabled && aws dynamodb delete-table --table-name infra-core-api-membership-external"
86+ // Membership Logs
87+ import {
88+ to = aws_dynamodb_table. membership_provisioning_log
89+ id = " ${ var . ProjectId } -membership-provisioning"
90+ }
91+ resource "aws_dynamodb_table" "membership_provisioning_log" {
92+ billing_mode = " PAY_PER_REQUEST"
93+ name = " ${ var . ProjectId } -membership-provisioning"
94+ deletion_protection_enabled = true
95+ hash_key = " email"
96+ point_in_time_recovery {
97+ enabled = true
8998 }
99+ attribute {
100+ name = " email"
101+ type = " S"
102+ }
103+ }
90104
105+ // API Keys
106+ import {
107+ to = aws_dynamodb_table. api_keys
108+ id = " ${ var . ProjectId } -api-keys"
109+ }
110+ resource "aws_dynamodb_table" "api_keys" {
111+ billing_mode = " PAY_PER_REQUEST"
112+ name = " ${ var . ProjectId } -api-keys"
113+ deletion_protection_enabled = true
114+ hash_key = " keyId"
115+ point_in_time_recovery {
116+ enabled = true
117+ }
118+ attribute {
119+ name = " keyId"
120+ type = " S"
121+ }
122+ ttl {
123+ attribute_name = " expiresAt"
124+ enabled = true
125+ }
91126}
Original file line number Diff line number Diff line change @@ -70,3 +70,46 @@ module "lambda_warmer" {
7070 source = " github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=v0.1.1"
7171 function_to_warm = " infra-core-api-lambda"
7272}
73+
74+
75+ // Membership Logs
76+ import {
77+ to = aws_dynamodb_table. membership_provisioning_log
78+ id = " ${ var . ProjectId } -membership-provisioning"
79+ }
80+ resource "aws_dynamodb_table" "membership_provisioning_log" {
81+ billing_mode = " PAY_PER_REQUEST"
82+ name = " ${ var . ProjectId } -membership-provisioning"
83+ deletion_protection_enabled = true
84+ hash_key = " email"
85+ point_in_time_recovery {
86+ enabled = true
87+ }
88+ attribute {
89+ name = " email"
90+ type = " S"
91+ }
92+ }
93+
94+ // API Keys
95+ import {
96+ to = aws_dynamodb_table. api_keys
97+ id = " ${ var . ProjectId } -api-keys"
98+ }
99+ resource "aws_dynamodb_table" "api_keys" {
100+ billing_mode = " PAY_PER_REQUEST"
101+ name = " ${ var . ProjectId } -api-keys"
102+ deletion_protection_enabled = true
103+ hash_key = " keyId"
104+ point_in_time_recovery {
105+ enabled = true
106+ }
107+ attribute {
108+ name = " keyId"
109+ type = " S"
110+ }
111+ ttl {
112+ attribute_name = " expiresAt"
113+ enabled = true
114+ }
115+ }
You can’t perform that action at this time.
0 commit comments