forked from easyawslearn/Terraform-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdynamodb.tf
43 lines (37 loc) · 870 Bytes
/
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
provider "aws" {
region = "us-east-1"
version = "~> 2.0"
}
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "DynamoDB-Terraform"
billing_mode = "PROVISIONED"
read_capacity = 20
write_capacity = 20
hash_key = "UserId"
range_key = "Name"
attribute {
name = "UserId"
type = "S"
}
attribute {
name = "Name"
type = "S"
}
ttl {
attribute_name = "TimeToExist"
enabled = false
}
global_secondary_index {
name = "UserTitleIndex"
hash_key = "UserId"
range_key = "Name"
write_capacity = 10
read_capacity = 10
projection_type = "INCLUDE"
non_key_attributes = ["UserId"]
}
tags = {
Name = "dynamodb-table"
Environment = "Training"
}
}