forked from GSI-Xapiens-CSIRO/sBeacon-BGSi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamodb.tf
137 lines (117 loc) · 2.63 KB
/
dynamodb.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#
# sBeacon DynamoDB Tables
#
resource "aws_dynamodb_table" "ontologies" {
billing_mode = "PAY_PER_REQUEST"
name = "sbeacon-Ontologies"
hash_key = "id"
tags = var.common-tags
attribute {
name = "id"
type = "S"
}
}
resource "aws_dynamodb_table" "descendant_terms" {
billing_mode = "PAY_PER_REQUEST"
name = "sbeacon-Descendants"
hash_key = "term"
tags = var.common-tags
attribute {
name = "term"
type = "S"
}
}
resource "aws_dynamodb_table" "anscestor_terms" {
billing_mode = "PAY_PER_REQUEST"
name = "sbeacon-Anscestors"
hash_key = "term"
tags = var.common-tags
attribute {
name = "term"
type = "S"
}
}
#
# Data Portal Tables
#
# User Projects
resource "aws_dynamodb_table" "projects" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "name"
name = "sbeacon-dataportal-projects"
tags = var.common-tags
attribute {
name = "name"
type = "S"
}
}
locals {
project_users_uid_index = "uid-index"
}
# User Projects Table
resource "aws_dynamodb_table" "project_users" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "name"
range_key = "uid"
name = "sbeacon-dataportal-project-users"
tags = var.common-tags
attribute {
name = "name"
type = "S"
}
attribute {
name = "uid"
type = "S"
}
global_secondary_index {
name = local.project_users_uid_index
hash_key = "uid"
range_key = "name"
projection_type = "KEYS_ONLY"
}
}
# Jupyter Notebooks Table
resource "aws_dynamodb_table" "juptyer_notebooks" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "uid"
range_key = "instanceName"
name = "sbeacon-dataportal-juptyer-notebooks"
tags = var.common-tags
attribute {
name = "uid"
type = "S"
}
attribute {
name = "instanceName"
type = "S"
}
}
# VCFs Table
# So we can keep track of the number of samples in each vcf
resource "aws_dynamodb_table" "vcfs" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "vcfLocation"
name = "sbeacon-vcfs"
tags = var.common-tags
attribute {
name = "vcfLocation"
type = "S"
}
}
# Keep User sagemaker Usage information
resource "aws_dynamodb_table" "sbeacon-dataportal-users-quota" {
name = "sbeacon-dataportal-users-quota"
billing_mode = "PAY_PER_REQUEST" # on demand
#read_capacity = 5
#write_capacity = 5
hash_key = "uid"
attribute {
name = "uid"
type = "S"
}
tags = {
Owner = "gaspi"
Environment = "dev"
Name = "sbeacon-backend"
}
}