-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathbigtable.tf
More file actions
50 lines (41 loc) · 1.34 KB
/
bigtable.tf
File metadata and controls
50 lines (41 loc) · 1.34 KB
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
locals {
cluster_id = "${local.name}-cluster"
bigtable_table_name = "${local.name}-table"
bigtable_default_column_family = "default_column_family"
bigtable_column_families = 21
// Note that it must match `main.rs`'s prefix for column families.
bigtable_column_family_prefix = "cf"
}
resource "google_bigtable_instance" "bigtable" {
name = "${local.name}-instance"
deletion_protection = false
cluster {
cluster_id = local.cluster_id
num_nodes = 1
storage_type = "SSD"
zone = local.subregion
}
depends_on = [google_project_service.bigtable]
}
resource "google_bigtable_table" "table" {
name = local.bigtable_table_name
instance_name = google_bigtable_instance.bigtable.name
dynamic "column_family" {
for_each = toset([for i in range(local.bigtable_column_families) : "${local.bigtable_column_family_prefix}${i}"])
content {
family = column_family.value
}
}
column_family {
family = local.bigtable_default_column_family
}
}
resource "google_bigtable_app_profile" "profile" {
instance = google_bigtable_instance.bigtable.name
app_profile_id = "${local.name}-profile"
single_cluster_routing {
cluster_id = local.cluster_id
allow_transactional_writes = true
}
ignore_warnings = true
}