Added HCL code for creating dynamodb table.
This commit is contained in:
@@ -35,3 +35,20 @@ resource "aws_security_group" "ec2_ssh_security" {
|
||||
}
|
||||
# For each protocol, new block; eg. egress { from... to... protocol = "icmp" cidr...}
|
||||
}
|
||||
|
||||
# DynamoDB Table
|
||||
resource "aws_dynamodb_table" "dynamo-test" {
|
||||
name = "testTable" # Table name
|
||||
billing_mode = "PROVISIONED" # Specify billing type; PROVISIONED (provisioned billing mode) / PAY_PER_REQUEST (on-demand billing mode)
|
||||
read_capacity = 1 # no. of reads per sec.
|
||||
write_capacity = 1 # no. of writes per sec.
|
||||
|
||||
# Attribute
|
||||
attribute {
|
||||
name = "username" # Col. name
|
||||
type = "S" # Col. type;
|
||||
# S -> String, N -> Number, B -> Binary, BOOL -> Boolean, List -> L (ordered collection of values), Map ->M (key-value pairs), Null -> NULL
|
||||
}
|
||||
|
||||
hash_key = "username" # Primary key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user