-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamodb_table.tf
More file actions
59 lines (48 loc) · 1.27 KB
/
dynamodb_table.tf
File metadata and controls
59 lines (48 loc) · 1.27 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
51
52
53
54
55
56
57
58
//List of things to implement: point_in_time_recovery, replica, server side encryption, stream_enabled , stream_view_type, s3 bucket source
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "PlantData"
billing_mode = "PROVISIONED"
read_capacity = 20
write_capacity = 20
hash_key = "UniqueID"
range_key = "SpeciesName"
attribute {
name = "UniqueID"
type = "N"
}
attribute {
name = "SpeciesName"
type = "S"
}
attribute {
name = "PopulationCount"
type = "N"
}
stream_enabled = true
stream_view_type = "NEW_AND_OLD_IMAGES"
ttl {
attribute_name = "TimeToExist"
enabled = true
}
//point in time recovery
//keeps the data in a second timeline for 35 days
point_in_time_recovery {
enabled = true
}
global_secondary_index {
name = "SpeciesNameIndex"
hash_key = "SpeciesName"
range_key = "PopulationCount"
write_capacity = 10
read_capacity = 10
projection_type = "INCLUDE"
non_key_attributes = ["UniqueID"]
}
/*replica {
region_name = "us-west-2" # Replace with the desired region for the replica
}*/
tags = {
Name = "dynamodb-table-1"
Environment = "production"
}
}