-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
53 lines (44 loc) · 1.03 KB
/
main.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
data "aws_region" "current" {}
data "external" "inspector_exists" {
program = [
"/bin/bash",
"${path.module}/scripts/check_inspector.sh",
"${data.aws_region.current.name}"
]
}
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "GameScores2"
billing_mode = "PAY_PER_REQUEST"
hash_key = "UserId"
range_key = "GameTitle"
attribute {
name = "UserId"
type = "S"
}
attribute {
name = "GameTitle"
type = "S"
}
attribute {
name = "TopScore"
type = "N"
}
ttl {
attribute_name = "TimeToExist"
enabled = false
}
global_secondary_index {
name = "GameTitleIndex"
hash_key = "GameTitle"
range_key = "TopScore"
write_capacity = 10
read_capacity = 10
projection_type = "INCLUDE"
non_key_attributes = ["UserId"]
}
tags = {
Name = "dynamodb-table-1"
Environment = "production"
IExist = "${data.external.inspector_exists.result.endpoint_exists}"
}
}