-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdynamodb.tf
41 lines (39 loc) · 887 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
variable "region" {}
provider "aws" {
region = var.region
}
resource "aws_dynamodb_table" "employee" {
name = "Employees"
billing_mode = "PROVISIONED"
read_capacity = 10
write_capacity = 10
hash_key = "types"
range_key = "emp_id"
attribute {
name = "types"
type = "S"
}
attribute {
name = "emp_id"
type = "S"
}
tags = {
Name = "dynamodb-table-1"
Environment = "production"
}
}
resource "aws_dynamodb_table_item" "employee" {
table_name = "aws_dynamodb_table.employee.name"
hash_key = "aws_dynamodb_table.employee.hash_key"
range_key = "aws_dynamodb_table.employee.range_key"
item = <<ITEMS
{
"types": {"S": "manager"},
"emp_id": {"S": "1"},
"first_name": {"S": "Yurii"},
"second_name": {"S": "Liaskovets"},
"default_salary": {"S": "2000"},
"experience": {"S": "1"}
}
ITEMS
}