-
Notifications
You must be signed in to change notification settings - Fork 5
/
dynamodb.tf
149 lines (127 loc) · 2.9 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
138
139
140
141
142
143
144
145
146
147
148
149
resource "aws_dynamodb_table" "datasets" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "id"
name = "Datasets"
tags = var.common-tags
attribute {
name = "id"
type = "S"
}
attribute {
name = "assemblyId"
type = "S"
}
global_secondary_index {
hash_key = "assemblyId"
name = "assembly_index"
non_key_attributes = [
"id",
"vcfLocations",
"vcfGroups",
"vcfChromosomeMap"
]
projection_type = "INCLUDE"
}
}
resource "aws_dynamodb_table" "ontologies" {
billing_mode = "PAY_PER_REQUEST"
name = "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 = "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 = "Anscestors"
hash_key = "term"
tags = var.common-tags
attribute {
name = "term"
type = "S"
}
}
resource "aws_dynamodb_table" "vcf_summaries" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "vcfLocation"
name = "VcfSummaries"
tags = var.common-tags
attribute {
name = "vcfLocation"
type = "S"
}
}
resource "aws_dynamodb_table" "variant_duplicates" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "contig"
range_key = "datasetKey"
name = "VariantDuplicates"
tags = var.common-tags
attribute {
name = "contig"
type = "S"
}
attribute {
name = "datasetKey"
type = "S"
}
}
# this table holds the query made by user
# this is used to control the lambdas that
# execute a given query
# resonses counts the completed lambdas
resource "aws_dynamodb_table" "variant_queries" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "id"
name = "VariantQueries"
tags = var.common-tags
attribute {
name = "id"
type = "S"
}
# enable this later to save cost
ttl {
attribute_name = "timeToExist"
enabled = true
}
}
# this table holds responses by perform query operation
# responseIndex is used to order and paginate
# this points to a JSON files with results
resource "aws_dynamodb_table" "variant_query_responses" {
billing_mode = "PAY_PER_REQUEST"
hash_key = "id"
range_key = "responseNumber"
name = "VariantQueryResponses"
tags = var.common-tags
attribute {
name = "id"
type = "S"
}
attribute {
name = "responseNumber"
type = "N"
}
local_secondary_index {
range_key = "responseNumber"
name = "responseNumber_index"
projection_type = "ALL"
}
# enable this later to save cost
ttl {
attribute_name = "timeToExist"
enabled = true
}
}